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
ParameterDescription

hCtx

VB API context handle.

hSrcCtx

Not used - should be same as hCtx.

AppName

Name of a source application.

nAppName

Name of a destination application.

DbName

Name of an existing database to copy.

nDbName

Name of a new database. See Database Name Limits.

Notes

Return Value

None.

Access

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

Example

Declare Function EsbCopyDatabase Lib "ESBAPIN" (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