Modifies the current value of a specified environment attribute. All environment attributes persist until the environment handle is freed with the OdbcFree function.
Because more than one environment handle can be allocated simultaneously, environment attribute settings on one environment are not affected when another environment is allocated. Once an environment attribute is set, that attribute’s value affects all data source connections that exist or become allocated under the specified environment.
ODBC.bdh
OdbcSetEnvAttr( in hEnvironment : number, in nAttribute : number, in sValue : string): boolean;
true if successful
false otherwise
Parameter | Description |
---|---|
hEnvironment | Environment handle that refers to a previously allocated environment information storage buffer. |
nAttribute |
Environment attribute of which the value is to be modified. This parameter must be set to one of the following values:
|
sValue |
New value for the environment attribute nAttribute. The following parameters are allowed: For nAttribute SQL_ATTR_CONNECTION_POOLING:
For nAttribute SQL_ATTR_CP_MATCH:
For nAttribute SQL_ATTR_ODBC_VERSION:
For nAttribute SQL_ATTR_OUTPUT_NTS:
|
var hEnv, hDbc: number; dcltrans transaction TConnect begin OdbcAlloc(SQL_HANDLE_ENV, hEnv); OdbcAlloc(SQL_HANDLE_DBC, hDbc, hEnv); OdbcSetEnvAttr(hEnv, SQL_ATTR_CONNECTION_POOLING, SQL_CP_ONE_PER_DRIVER); OdbcConnect(hDbc, "DSN=database;UID=user;PWD=pass;"); end TConnect;