# EsbLogin

Description

EsbLogin() logs a user in to an Essbase server. This function should normally be called after executing a successful call to EsbInit(), and prior to making any other VB API calls which require a context handle argument.

Syntax

    EsbLogin (hInst, Server, User, Password, pItems, hCtx)

    ByVal hInst    As Long
    ByVal Server   As String
    ByVal User     As String
    ByVal Password As String
          pItems   As Integer
          hCtx     As Long

Parameters

hInst | Essbase VB API instance handle.
Server | Network server name string. Required field.
User | User name string. Required field.
Password | Password string. Required field.
pItems | Address of variable to receive Items of accessible applications/databases.
hCtx | Pointer to an Essbase context handle.

Return Value

If successful, returns an Essbase context handle in phCtx, which can be used as an argument in subsequent calls to other API functions. Also returns a Items of databases accessible to the specified user in pItems, and generates a list of accessible applications and databases that can be read by calling EsbGetNextItem().

Notes

- If you are programming in Microsoft Windows, you should consider using the EsbAutoLogin() function instead of EsbLogin().
- You can call EsbLogin() more than once for the same user name and server. The API returns a unique context handle for each login to the specified server.

Access

Before calling this function, you must first initialize the API and obtain a valid instance handle by calling the EsbInit() function.

Example

    Declare Function EsbLogin Lib "ESBAPIW" (ByVal hInst As Long, ByVal Server As String, ByVal User As String, ByVal Password As String, Items As Integer, hCtx As Long) As Long

    Sub ESB_Login ()
       Dim hInst As Long
       Dim Server As String * ESB_SVRNAMELEN
       Dim User As String * ESB_USERNAMELEN
       Dim Password As String * ESB_PASSWORDLEN
       Dim Items As Integer
       Dim AppDb As ESB_APPDB_T
       Dim hCtx As Long

       '*****************
       ' Login to Essbase
       '*****************
       sts = EsbLogin (hInst, Server, User, Password, Items, hCtx)

       For n = 1 To Items

       '*******************************
       ' Get next Application/Database
       ' name combination from the list
       '*******************************
       sts = EsbGetNextItem (hCtx, ESB_LAPPDB_TYPE,AppDb)
       Next
    End Sub

See Also

EsbAutoLogin()
EsbInit()
EsbListDatabases
EsbLogout()
EsbSetActive()
EsbGetNextItem()