Core subroutine
Allocate memory for a connection handle.
call EDSAllocConnect(HENV_IV, HDBC_IV )
HENV_IV
An input integer value indicating the environment handle.
HDBC_IV
An output integer value indicating the connection handle.
Description
When your application passes the address of a variable to EDSAllocConnect, EDS allocates memory and stores the value of the associated handle into the variable. Your application can then pass the HDBC_IV value in all subsequent calls that require a connection handle.
If HDBC_IV references a connection handle that is already allocated, EDS returns without processing the call.
Return Values
EDSAllocConnect returns EDS_SUCCESS, EDS_INVALID_HANDLE, or EDS_ERROR.
If the driver returns EDS_ERROR, EDS sets HDBC_IV to EDS_NULL_HDBC. To obtain additional information, your application can call EDSError with HDBC_IV and HSTMT_IV set to EDS_NULL_HDBC and EDS_NULL_HSTMT, respectively.
When EDSAllocConnect returns EDS_ERROR, you can obtain an associated SQLSTATE value with more specific information by calling EDSError. The following table lists each typical SQLSTATE value and explains each one in the context of the command EDSAllocConnect.
The following table lists possible SQLSTATE values.
SQL STATE |
Error |
Description |
S1000 |
General error |
An error occurred for which there was no specific SQLSTATE and for which no implementation-specific SQLSTATE was defined. The error message returned by EDSError in the argument ERRORTEXT describes the error and its cause. |
S1001 |
Memory allocation failure |
The Driver Manager or driver was unable to allocate memory for the connection handle. |
See Also
EDSConnect activates a connection.
EDSFreeConnect frees a connection handle (the opposite of EDSAllocConnect).