3.3.2 SQLSetEnvAttr()

Table of Contents Previous Next



You can use the SQLSetEnvAttr() function to set the values of environment attributes. The signature of the function is:
SQLHENV env_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 assigned to the attribute. The value will be a NULL terminated character string or a 32 bit integer value depending on the specified attribute.
If value_pointer is a pointer to a binary buffer or character string, string_length is the length of value_pointer. If the value being assigned to the attribute is a character, string_length is the length of that character string. If value_pointer is NULL, string_length is not returned. If value_pointer is an integer, string_length is ignored.
SQLSetEnvAttr() returns SQL_SUCCESS, SQL_INVALID_HANDLE, SQL_ERROR or SQL_SUCCESS_WITH_INFO.
The application must call SQLSetEnvAttr() before allocating a connection handle; all values applied to environment attributes will persist until SQLFreeHandle() is called for the connection. ODBC version 3.x allows you to allocate multiple environment handles simultaneously.
Defaults to SQL_TRUE. Calls that set this attribute to SQL_FALSE return SQL_ERROR/SQLSTATEHYC00 (feature not implemented).


Table of Contents Previous Next