Copies an object to the server or client object system.
Syntax
ESS_FUNC_M EssCopyObject (hSrcCtx, hDestCtx, ObjType, SrcApp, DestApp, SrcDb, DestDb, SrcObj, DestObj);
Parameter | Data Type | Description |
---|---|---|
hSrcCtx | ESS_HCTX_T | API context handle for source object. Can be local context handle returned by EssCreateLocalContext(). |
hDestCtx | ESS_HCTX_T | API context handle for destination object. Can be local context handle returned by EssCreateLocalContext(). |
ObjType | ESS_OBJTYPE_T | Object type (must be single type). See Bitmask Data Types for possible values. |
SrcApp | ESS_STR_T | Source application name. |
DestApp | ESS_STR_T | Destination application name. |
SrcDb | ESS_STR_T | Source database name. If NULL, uses the source application subdirectory. |
DestDb | ESS_STR_T | Destination database name. If NULL, uses the destination application subdirectory. |
SrcObj | ESS_STR_T | Name of source object to copy from. |
DestObj | ESS_STR_T | Name of destination object to copy to. See Object Name Limits. |
Notes
Objects may be copied from client to server, server to client, within the same server. In all cases the destination object must either not already exist or it must be locked by the caller.
Outline objects cannot be copied. Use the EssCopyDatabase() function to copy a database, including its associated outline.
Return Value
None.
Access
This function requires the caller to have the appropriate level of access to the specified source application and/or database containing the object (depending on the object type), and to have Application or Database Design privilege (ESS_PRIV_APPDESIGN or ESS_PRIV_DBDESIGN) for the specified destination application or database.
Example
ESS_FUNC_M ESS_CopyObject(ESS_HCTX_T hCtx) { ESS_FUNC_M sts = ESS_STS_NOERR; ESS_HCTX_T hDestCtx; ESS_STR_T SrcApp; ESS_STR_T DestApp; ESS_STR_T SrcDb; ESS_STR_T DestDb; ESS_STR_T SrcObj; ESS_STR_T DestObj; ESS_OBJTYPE_T ObjType; hDestCtx = hCtx; SrcApp = "Sample"; SrcDb = "Basic"; SrcObj = "Test"; DestApp = "Sample"; DestDb = "Basic"; DestObj = "NewTest"; ObjType = ESS_OBJTYPE_TEXT; sts = EssCopyObject(hCtx,hDestCtx,ObjType,SrcApp, DestApp,SrcDb,DestDb,SrcObj,DestObj); if(!sts) printf("The Object is copied.\r\n"); return (sts); }
See Also