Home | Previous Page | Next Page   Error Messages > Mapping Informix Error Messages to SQLSTATE Values >

SQLAllocEnv (Core Level Only)

SQLAllocEnv allocates memory for an environment handle and initializes the driver call level interface for application use. An application must call SQLAllocEnv before it calls any other driver function.

A driver cannot return SQLSTATE values directly after the call to SQLAllocEnv because no valid handle exists with which to call SQLError.

Two levels of SQLAllocEnv functions exist, one within the driver manager (if you are using one) and one within the driver. The driver manager does not call the driver-level function until the application calls SQLConnect, SQLBrowseConnect, or SQLDriverConnect. If an error occurs in the driver-level SQLAllocEnv function, the driver manager-level SQLConnect, SQLBrowseConnect, or SQLDriverConnect function returns SQL_ERROR. A subsequent call to SQLError with henv, SQL_NULL_HDBC, and SQL_NULL_HSTMT returns SQLSTATE IM004 (the driver SQLAllocEnv function failed), followed by one of the following errors from the driver:

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]