EsbAutoLogin

Description

EsbAutoLogin() displays a dialog box which allows the user to log in to an Essbase server, and optionally select an active application and database.

Syntax

EsbAutoLogin (hInst, Server, User, Password, AppName, DbName, opt, pAccess, phCtx)
ByVal hInst    As Long
ByVal Server   As String
ByVal User     As String
ByVal Password As String
ByVal AppName  As String
ByVal DbName   As String
ByVal opt      As Integer
      pAccess  As Integer
      phCtx    As Long

Parameters

hInstEssbase VB API instance handle.
ServerNetwork server name string.
UserUser name string.
PasswordPassword string.
AppNameApplication name.
DbNameDatabase name.
OptionsOptions flag. Values:

ESB_AUTO_NODIALOG: Attempts to log the user in without displaying the dialog, using the default settings (from the above arguments).

ESB_AUTO_NOSELECT: Allows the user to log in without selecting an application and database (lower part of the dialog is not displayed).

You can add ESB_AUTO_NODIALOG and ESB_AUTO_NOSELECT together to log in a user without a dialog box and not select an application and database.

ESB_AUTO_NODIALOG + ESB_AUTO_NOSELECT

ESB_AUTO_DEFAULT: Allows the user to log in and select an application and database interactively in the dialog box.

pAccessAddress of variable to receive database access level.
phCtxAddress of variable to receive Essbase context handle.

Return Value

If successful, returns an Essbase context handle in phCtx, which can be passed as an argument in subsequent calls to other VB API functions. Also returns the user's access level to the selected application and database (if selected) in pAccess.

Notes

Access

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

Example

Declare Function EsbAutoLogin Lib "ESBAPIW" (ByVal hInst As Long, ByVal Server As String, _
                                             ByVal User As String, ByVal Password As String, _
                                             ByVal AppName As String, ByVal DbName As String, _
                                             ByVal Opt As Integer, pAccess As Integer, _
                                             phCtx As Long) As Long
Sub ESB_AutoLogin ()
   Dim sts As Long
   Dim Server As String * ESB_SVRNAMELEN
   Dim User As String * ESB_USERNAMELEN
   Dim Password As String * ESB_PASSWORDLEN
   Dim AppName As String * ESB_APPNAMELEN
   Dim DbName As String * ESB_DBNAMELEN
   Dim pOption As Integer
   Dim pAccess As Integer
   Dim hCtx As Long 
   '**********************
   ' Initialize parameters
   '********************** 
   Server = "Server"
   User = "User"
   Password = "Password"
   AppName = ""
   DbName = ""
   pOption = ESB_AUTO_DEFAULT 
   '************************
   ' Login to Essbase server
   '************************ 
   sts = EsbAutoLogin (hInst, Server, User, Password, AppName, DbName, pOption, pAccess, hCtx)
End Sub

See Also

EsbInit()
EsbListDatabases
EsbLogin()
EsbLogout()
EsbSetActive()