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
hInst | Essbase VB API instance handle. |
Server | Network server name string. |
User | User name string. |
Password | Password string. |
AppName | Application name. |
DbName | Database name. |
Options | Options 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.
|
pAccess | Address of variable to receive database access level.
|
phCtx | Address 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
- The dialog box returned by this function is automatically
managed by the function, and provides features in the login dialog
to change the user password, display the database note message,
etc., and so provides a standardized and powerful login screen
for all applications using the VB API.
- Use this function instead of the EsbLogin() function
if you are programming in the Windows or Windows NT environments.
- The function should be called after executing a successful
call to EsbInit(), and prior to making any other VB API
calls which require a context handle argument.
- This function is supported only in the Windows 95 and Windows NT environments.
It is not supported in UNIX environments.
- The string arguments Server, User, Password,
AppName or DbName must be included. They may optionally
be an empty string. If any are not an empty string, the buffers
they point to are updated on returning from the function with
the actual values selected by the user from the dialog box. If
any of the passed-in arguments point to valid strings, they are
used as the default displayed values in the dialog. The buffers
for these arguments must be large enough to contain any possible
return value, not just the values passed in.
- If the login is successful, the server and user names are
automatically stored (in the file ESSBASE.INI) and are used as
the defaults the next time this function is called (unless those
arguments are specified in subsequent calls). The names of all
servers which have been successfully connected to are also stored
and displayed.
- The auto login dialog box is a child window of the current
active window (the window that has the focus). Therefore avoid
destroying the active window or changing focus while the auto
login dialog is displayed.
- This function returns a value of ESB_STS_CANCEL if the user
presses the Cancel button or the Esc key in the dialog box.
- In the Windows or NT environments, if the end user clicks
the Help button, the ESSAPIW.HLP file is opened and the corresponding
topic appears. You can redirect the Help button to point to a
different help file by specifying a different help file name in
the ESB_INIT_T structure.
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()