# EsbSetActive

Description

EsbSetActive() sets the caller's active application and database.

Syntax

    EsbSetActive (hCtx, AppName, DbName, pAccess)

    ByVal hCtx    As Long
    ByVal AppName As String
    ByVal DbName  As String
    ByVal pAccess As Integer

Parameters

hCtx | Essbase VB API context handle.
AppName | Application name.
DbName | Database name.
pAccess | Address of variable to receive the user's access level to the selected Database. See Bitmask Data Types for a list of possible values for this field.

Return Value

If successful, returns the user's access level to the selected application and database in pAccess.

Notes

- If the application and database have not been loaded, this function will load them.
- The EsbAutoLogin() function can also be used to allow a user to login and set the active application and database.

Access

This function requires no special privileges.

Example

    Declare Function EsbSetActive Lib "ESBAPIW" (ByVal hCtx As Long, ByVal AppName As String, ByVal DbName As String, Access As Integer) As Long

    Sub ESB_SetActive ()
       Dim AppName As String
       Dim DbName As String
       Dim pAccess As Integer
       Dim sts As Long

       AppName = "Demo"
       DbName = "Basic"
       '**********************************
       ' Set active Application & Database
       '**********************************
       sts = EsbSetActive (hCtx, AppName, DbName, pAccess)
    End Sub

See Also

EsbClearActive()
EsbGetActive()
EsbListApplications()
EsbListDatabases()
EsbLogin()
EsbSetActive()