EssCopyDatabase

Description

EssCopyDatabase() copies an existing database, either on the client or the server, to a new database, including all associated databases and objects. If the database is copied on the server, the new database is started.

Syntax

ESS_FUNC_M EssCopyDatabase (hCtx, hSrcCtx, SrcApp, DestApp, SrcDb, DestDb);
ESS_HCTX_ThCtx
ESS_HCTX_ThSrcCtx
ESS_STR_TSrcApp
ESS_STR_TDestApp;
ESS_STR_TSrcDb;
ESS_STR_TDestDb

Parameters

hCtxEssbase API context handle.
hSrcCtxNot used - should be same as hCtx.
SrcAppName of source application.
DestAppName of destination application.
SrcDbName of existing database to copy.
DestDbName of new database.

Return Value

None.

Notes

Access

For a server database, the caller must have database Create/Delete/Edit privilege (ESS_PRIV_DBCREATE), and database designer privilege on the source database to be copied (ESS_PRIV_DBDESIGN).

Example


ESS_FUNC_M 

ESS_CopyDatabase(ESS_HCTX_T hCtx)

{

   ESS_FUNC_M     sts = ESS_STS_NOERR;

   ESS_HCTX_T    hSrcCtx;

   ESS_STR_T     SrcApp; 

   ESS_STR_T     DestApp;

   ESS_STR_T     SrcDb;

   ESS_STR_T     DestDb;

   

   hSrcCtx = hCtx;

   SrcApp  = "Sample";

   DestApp = "NewSamp";

   SrcDb   = "Basic";

   DestDb  = "NewBasic";

   

   sts = EssCopyDatabase(hCtx, hSrcCtx, SrcApp,

         DestApp, SrcDb, DestDb);

   

   return(sts);

}

See Also

EssCopyApplication()
EssCopyObject()