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);
ParameterData TypeDescription

hCtx

ESS_HCTX_T

API context handle.

hSrcCtx

ESS_HCTX_T

Not used - should be same as hCtx.

SrcApp

ESS_STR_T

Name of source application.

DestApp;

ESS_STR_T

Name of destination application.

SrcDb;

ESS_STR_T

Name of existing database to copy.

DestDb

ESS_STR_T

Name of new database. See Database Name Limits.

Notes

Return Value

None.

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