EsbRenameDatabase

Renames an existing database within an application, either on the client or the server. If the database is running on the server, it is first stopped.

Syntax

EsbRenameDatabase (hCtx, AppName, DbName, nDbName)
ByVal hCtx    As Long
ByVal AppName As String
ByVal DbName  As String
ByVal nDbName As String
ParameterDescription

hCtx

VB API context handle. Can be local context handle returned from EsbCreateLocalContext().

AppName

Application name.

DbName

Name of an existing database to rename.

nDbName

New name of the database. See Database Name Limits.

Notes

Renaming a client database renames the local database directory.

Return Value

None.

Access

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

Example

Declare Function EsbRenameDatabase Lib "ESBAPIN" (ByVal hCtx As Long, ByVal AppName As String, ByVal OldName As String, ByVal NewName As String) As Long 

Sub ESB_RenameDatabase ()
   Dim sts As Long
   Dim AppName As String
   Dim OldName As String
   Dim NewName As String    AppName = "Sample"
   OldName = "Basic"
   NewName = "NewBasic"   '****************
   ' Rename database
   '****************
   sts = EsbRenameDatabase (hCtx, AppName,
         OldName, NewName)
End Sub 

See Also