# EsbSetApplicationState

Description

EsbSetApplicationState() sets user-configurable parameters for the application using the application's state structure.

Syntax

    EsbSetApplicationState (hCtx, AppName, pAppState)

    ByVal hCtx      As Long
    ByVal AppName   As String
    ByVal pAppState As ESB_PAPPSTATE_T

Parameters

hCtx | Essbase VB API context handle.
AppName | Application name.
pAppState | Pointer to application state structure.

Return Value

None.

Notes

- When changing parameter values, it is advisable to call EsbGetApplicationState() first to get the correct values of any parameters you do not wish to change.

Access

This function requires the caller to have Application Designer privilege (ESB_PRIV_APPDESIGN) for the specified application.

Example

    Declare Function EsbSetApplicationState Lib "ESBAPIW" (ByVal hCtx As Long, ByVal AppName As String, AppState As ESB_APPSTATE_T) As Long

    Sub ESB_SetApplicationState ()
       Dim sts As long
       Dim AppName As String
       Dim AppState As ESB_APPSTATE_T

       AppName = "Sample"
       AppState.Description = "This is a test application"
       AppState.Loadable = ESB_TRUE
       AppState.Autoload = ESB_TRUE
       AppState.Access = ESB_PRIV_APPCREATE
       AppState.Connects = ESB_TRUE
       AppState.Commands = ESB_TRUE
       AppState.Updates = ESB_TRUE
       AppState.Security = ESB_TRUE
       AppState.LockTimeout = 1000

       '********************************
       ' Set Application State structure
       '********************************
       sts = EsbSetApplicationState (hCtx, AppName, AppState)
    End Sub

See Also

EsbGetApplicationState()
EsbSetDatabaseState()