skip to main content
Interface Provider API : Reference : OAIP_init
 

OAIP_init

This IP function is called when the OpenAccess SDK SQL engine starts up. The IP returns an environment handle to the OpenAccess SDK SQL engine. The OpenAccess SDK SQL engine passes this handle back to the IP in many of the other calls.
int OAIP_init(
    TM_ModuleCB tmHandle,
    XM_Tree * pMemTree,
    IP_HENV * phenv)
Table 17. Parameters for OAIP_init
Parameter
Type
Description
Parameter
Type
Description
IN
tmHandle
TM_ModuleCB
The handle to use for tracing with tm_trace.
pMemTree
XM_Tree *
The memory tree to use for allocating items with xm_allocItem calls.
OUT
phenv
IP_HENV *
A pointer to the data structure allocated by the IP to keep its information. This handle is passed in to the IP on subsequent IP calls.
RETURN
int
DAM_SUCCESS - on success
DAM_FAILURE - on failure
DAM_NOT_AVAILABLE - data source is not available or no driver.
Note: When the IP fails initialization, it is not considered a fatal error. The OpenAccess SDK service starts and posts a warning message to the session log file. The OpenAccess SDK client reports an "IP not available" error if an application tries to connect to a data source configured for that IP.
Note: Regarding multithreaded mode: This function is called only once from the main thread. In a client/server build, this function is called by the main thread of the OpenAccess SDK Server. In a local build, this function is called during DLL initialization on the client application's thread that is loading the DLL.