The API requires that your program call certain functions before others. These are the basic ordering rules:
A program must call EsbInit() before calling any other API functions.
A program must call EsbLogin() or EsbAutoLogin() before calling any API functions which require a context handle argument (most API functions). Additionally, if you need to create a local context for API object functions to use, you must call EsbCreateLocalContext() before calling any API functions requiring a context handle argument.
Some API functions require an active application and database to be set. This is done by having the program call EsbSetActive() or EsbAutoLogin() before they are called.
A program must not pass a context handle to any API functions after calling EsbLogout() for that handle.
A program must not call any API functions except EsbInit() after calling EsbTerm().
Topics that discuss Visual Basic API task sequence: