This section describes calling API functions, using instance and context handles, and handling return codes.
If you are using the API with Visual Basic, you need to include the correct function and constant declaration in your program. The file ESB32.BAS in \ESSBASE\API\INCLUDE contains the correct function and constant declarations.
The ESB32.BAS file is required for 32-bit Visual Basic programs because 32-bit programs use two bytes per character instead of one. Since some Essbase Visual Basic data structures use one-byte data types, ESB32.BAS changes these to use two bytes.
Add ESB32.BAS to your project, or, if you are using your own file for global declarations, copy the declarations included in ESB32.BAS into it.
Passing the Instance Handle or Context Handle
You must pass the instance handle returned by the initial call to EsbInit() in calls to EsbLogin() or EsbTerm(). You must pass the context handle returned by EsbLogin() in any function calls associated with a specific login.
All Essbase API functions return a status code of type ESB_STS_T. A return code of zero indicates that the function was executed successfully, and a non-zero value indicates an error condition. A full list of error return constants is contained in the header files ESSERROR.H and ESBERROR.BAS.
Note: | You should always check the return code from any Essbase API function. If the return code is non-zero, any pointers or values returned by the function are undefined. |