3.2.2 SQLSetConnectAttr()You can use the ODBC SQLSetConnectAttr() function to set the values of connection attributes. The signature of the function is:SQLHDBC conn_handle, // InputSQLINTEGER attribute, // InputSQLPOINTER value_pointer, // InputSQLINTEGER string_length, // Inputattribute identifies the attribute whose value you wish to setA 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().Connection attributes have a specific time frame in which they can be set. Some attributes must be set before the connection is established, while others can only be set after a connection is established.