# EsbRenameDatabase

Description

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

Parameters

hCtx | Essbase 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. Database names can be 8 characters long, and can contain all special characters allowed in DOS file names. No spaces, commas, tabs, slashes, backslashes, or periods are allowed. The use of some special characters is not recommended because they are often used by the operating system (for example, @, $, %, and &).

Return Value

None.

Notes

- Renaming a client database renames the local database directory.

Access

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

Example

    Declare Function EsbRenameDatabase Lib "ESBAPIW" (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

EsbRenameApplication()
EsbRenameObject()