3.2.2 SQLSetConnectAttr()

Table of Contents Previous Next



You can use the ODBC SQLSetConnectAttr() function to set the values of connection attributes. The signature of the function is:
SQLHDBC conn_handle, // Input
SQLINTEGER attribute, // Input
SQLPOINTER value_pointer, // Input
SQLINTEGER string_length, // Input
attribute identifies the attribute whose value you wish to set
A pointer to the value that the attribute will assume.
If attribute is defined by ODBC and value_pointer points to a binary buffer or character string, string_length is the length of value_pointer. If value_pointer points to a fixed-length value (such as an integer), string_length is ignored.
If EDB-ODBC defines the attribute, the application sets the string_length parameter. Possible string_length values are:
The result of SQL_LEN_BINARY_ATTR(length)
SQL_IS_INTEGER or SQL_IS_UINTEGER
SQLSetConnectAttr() returns SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR, SQL_STILL_EXECUTING or SQL_INVALID_HANDLE.
You can call SQLSetConnectAttr() any time after the connection handle is allocated, until the time that the connection is closed with a call to SQLFreeHandle(). All attributes set by the call persist until the call to SQLFreeHandle().


Table of Contents Previous Next