# EsbGetActive

Description

EsbGetActive() gets the names of the caller's current active application and database.

Syntax

    EsbGetActive (hCtx, AppName, szApp, DbName, szDb, pAccess)

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

Parameters

hCtx | Essbase VB API context handle.
AppName | Buffer to receive an application name string.
szApp | Size of an application name string buffer.
DbName | Buffer to receive a database name string.
szDb | Size of the database name string buffer.
pAccess | Address of variable to receive the user's access level to the selected database.

Return Value

If successful, returns the user's selected active application and database in AppName and DbName.

Notes

- If application/database name length is greater that the size of the buffer, the name is truncated.

Access

This function requires no special privileges.

Example

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

    Sub ESB_GetActive ()
       Dim AppName As String * ESB_APPNAMELEN
       Dim DbName As String * ESB_DBNAMELEN
       Dim sts As Long
       Dim szApp As Integer
       Dim szDb As Integer
       Dim pAccess As Integer

       szApp = ESB_APPNAMELEN
       szDb = ESB_DBNAMELEN

       '**********************************
       ' Get active Application & Database
       '**********************************
       sts = EsbGetActive (hCtx, AppName, szApp, DbName, szDb, Access)
    End Sub

See Also

EsbClearActive()
EsbSetActive()