3.2 Connection Attributes

Table of Contents Previous Next


3 EDB-ODBC Driver Functionality : 3.2 Connection Attributes

You can use the ODBC SQLGetConnectAttr() and SQLSetConnectAttr() functions to retrieve or set the value of a connection attribute.
The SQLGetConnectAttr() function returns the current value of a connection attribute. The signature is:
SQLHDBC conn_handle, //Input
SQLINTEGER attribute, //Input
SQLPOINTER value_pointer, //Output
SQLINTEGER buffer_length, //Input
SQLINTEGER *string_length_pointer //Output
attribute identifies the attribute whose value you wish to retrieve.
If attribute is defined by ODBC and value_pointer points to a character string or binary buffer, buffer_length is the length of value_pointer. If value_pointer points to a fixed-size value (such as an integer), buffer_length is ignored.
If EDB-ODBC defines the attribute, SQLGetConnectAttr() sets the buffer_length parameter. buffer_length can be:
The result of SQL_LEN_BINARY_ATTR(length)
SQL_IS_INTEGER or SQL_IS_UINTEGER
A pointer to a SQLINTEGER that receives the number of bytes available to return in value_pointer. If value_pointer is NULL, string_length_pointer is not returned.
This function returns SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_NO_DATA, SQL_ERROR or SQL_INVALID_HANDLE.

3 EDB-ODBC Driver Functionality : 3.2 Connection Attributes

Table of Contents Previous Next