Visual Basic Main API Common Problems and Solutions

If the API function you are calling is likely to generate a lot of data in a return parameter, such as calls to EsbLogin(), EsbAutoLogin(), EsbGetString(), and EsbListDatabases(), you should ensure that you have reserved enough buffer space to receive the data.

might assist you in identifying and solving problems.

Table 8. Visual Basic Main API Common Problems and Solutions

ProblemSolution

Your program is generating protection faults.

If you are having this problem with a Visual Basic program, check the declared indirection level of any pointers being passed to the API.

Your program generates an Essbase error when calling an API function.

Most of the Essbase error messages are self-explanatory, and it should be fairly obvious where the problem lies. However a couple of common errors to watch out for are (%n indicates a message argument which is replaced by a context-specific string):

  • "NULL argument (%1) passed to ESSAPI function %2". This message indicates that one or more arguments passed to the API function %2 were NULL. The %1 indicates the number of the first null argument (1-based).

  • "Invalid call sequence in ESSAPI function %1". This message indicates that you have made a call to an API function (%1) when another function call was required. For example, if you have executed a report function, such as EsbReport(), make sure that you call EsbGetString() repeatedly until a NULL string is returned; or if you have executed a calculation function, e.g. EsbCalc(), that you repeatedly check the calculation state by calling EsbGetProcessState() until the returned value indicates that the calc has completed.

  • "Local operation not allowed in ESSAPI function %s". You have passed a local context handle to a function which does not allow it; use a login context handle instead.

  • "Cannot open message database %s". The message database is not accessible on the machine on which your program is running. Ensure that the message database is where Essbase expects to find it. Essbase first examines the MessagePath field of the initialization structure passed to EsbInit(), then the directory and file name specified by the ARBORMSGPATH environment variable, and finally, the $ESSBASEPATH\BIN directory where $ESSBASEPATH is an environment variable. If the message database is not available in any of these directories, Essbase returns an error message at run time. Verify which setting Essbase uses, and then verify that the message database is located where specified. See Integrating Essbase With Your Product.

Your program is consistently receiving an Essbase error return code from an API function, but no message is displayed, or a message saying "No message for message #%1 in message database" is generated.

Certain internal API errors cannot display a message, typically because the user's context information is not available when the message occurs. In these cases, make a note of the error code returned from the function, then refer to the list of error messages in the header file ESSERROR.H to find the corresponding message text.