EsbCopyDatabase

Description

EsbCopyDatabase() 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
EsbCopyDatabase (hCtx, hSrcCtx, AppName, nAppName, DbName, nDbName)
ByVal hCtx     As Long
ByVal hSrcCtx  As Long
ByVal AppName  As String
ByVal nAppName As String
ByVal DbName   As String
ByVal nDbName  As String

Parameters

hCtxEssbase VB API context handle.
hSrcCtxNot used - should be same as hCtx.
AppNameName of a source application.
nAppNameName of a destination application.
DbNameName of an existing database to copy.
nDbNameName of a new database.

Return Value

None.

Notes

Access

For a server database, the caller must have database Create/Delete/Edit privilege (ESB_PRIV_DBCREATE).

Example

Declare Function EsbCopyDatabase Lib "ESBAPIW" (ByVal hCtx As Long, ByVal hSrcCtx As Long, ByVal SrcApp As String, ByVal DestApp As String, ByVal SrcDb As String, ByVal DestDb As String) As Long

Sub ESB_CopyDatabase ()
   Dim sts As Long
   Dim SrcApp As String
   Dim DestApp As String 
   Dim SrcDb As String
   Dim DestDb As String 
   Dim hSrcCtx As Long

   hSrcCtx = hCtx
   SrcApp = "Sample"
   DestApp = "NewSamp"
   SrcDb = "Basic"
   DestDb = "NewBasic"

   '***************
   ' Copy database
   '***************

   sts = EsbCopyDatabase (hCtx, hSrcCtx, SrcApp,
   DestApp, SrcDb, DestDb)
End Sub 

See Also

EsbCopyApplication()
EsbCopyObject()