# EsbSetDatabaseState

Description

EsbSetDatabaseState() sets user-configurable parameters for the database using the database's state structure.

Syntax

    EsbSetDatabaseState (hCtx, AppName, DbName, pDbState)

    ByVal hCtx     As Long
    ByVal AppName  As String
    ByVal DbName   As String
    ByVal pDbState As ESB_PDBSTATE_T

Parameters

hCtx | Essbase VB API context handle.
AppName | Application name.
DbName | Database name.
pDbState | Pointer to a database state structure.

Return Value

None.

Notes

- EsbGetDatabaseState() should be called to initialize the ESB_DBSTATE_T structure before EsbSetDatabaseState() is called.
- This function can only set user-configurable parameters for server databases.

Access

This function requires the caller to have Database Design privilege (ESB_PRIV_DBDESIGN) for the specified database.

Example

    Declare Function EsbSetDatabaseState Lib "ESBAPIW" (ByVal hCtx As Long, ByVal AppName As String, ByVal DbName As String, DbState As ESB_DBSTATE_T) As Long

    Sub ESB_SetDatabaseState ()
       Dim sts As Long
       Dim AppName As String
       Dim DbName As String
       Dim DbState As ESB_DBSTATE_T

       AppName = "Sample"
       DbName = "Basic"
       ************************************
       ' Initialize DbState structure fields
       '************************************
       ' DbState.Description = "This is Sample/Basic"
       DbState.Loadable = "1"
       '*****************************
       ' Set Database state structure
       '*****************************
       sts = EsbSetDatabaseState (hCtx, AppName,
             DbName, DbState)
    End Sub

See Also

EsbGetDatabaseState()
EsbSetApplicationState()