EsbInit() initializes the Essbase VB API and message database. The ESB_INIT_T structure passed to this function includes a number of initialization parameters, including the name of the message database, the flag indicating whether to use a customized error handler, the maximum message stack size to be used by this error handler, the name and location of your help file, and version number.
EsbInit (pInit, phInst)
pInit As ESB_INIT_T phInst As Long
pInit | Pointer to Essbase VB API initialization structure. |
phInst | Pointer to Essbase VB API instance handle. |
EsbInit() returns an instance handle in phInst. The returned instance handle allows multiple applications to independently access the VB API (for DLLs only). The instance handle should be preserved and passed to the EsbLogin() and EsbTerm() functions.
Declare Function EsbInit Lib "ESBAPIW.DLL" (Init As ESB_INIT_T, hInst As Long) As Long Sub ESB_Init () Dim hInst As Long Dim Init As ESB_INIT_T Dim sts As Long ESB_FALSE = 0 ESB_TRUE = 1 '********************** ' Define init structure '********************** Init.Version = ESB_API_VERSION Init.MaxHandles = 10 Init.LocalPath = "C:\ESSBASE" ' Use default message file Init.MessageFile ="" ' Use EsbGetMessage to retrieve ' messages Init.ClientError = ESB_TRUE Init.ErrorStack = 100 '******************* ' Initialize the API '******************* sts = EsbInit (Init, hInst) End SubEsbLogin()