CODBC.GetConnectAttrmethod
Returns the current setting of a connection attribute.
Syntax
FUNCTION GetConnectAttr (BYVAL Attribute AS SQLINTEGER, BYVAL ValuePtr AS SQLPOINTER, BYVAL BufferLength AS SQLINTEGER, BYVAL StringLength AS SQLINTEGER PTR) AS SQLRETURN
FUNCTION GetConnectAttr (BYVAL Attribute AS SQLINTEGER, BYVAL ValuePtr AS SQLPOINTER, FUNCTION GetConnectAttrStr (BYREF wszAttribute AS WSTRING) AS DWSTRING
Parameters
| Name | Description | |
|---|---|---|
Attribute | Attribute to retrieve. | |
ValuePtr | A pointer to memory in which to return the current value of the attribute specified by Attribute. | |
BufferLength | If Attribute is an ODBC-defined attribute and ValuePtr points to a character string or a binary buffer, this argument should be the length of ValuePtr. If Attribute is an ODBC-defined attribute and ValuePtr is an integer, BufferLength is ignored. If Attribute is a driver-defined attribute, the application indicates the nature of the attribute to the Driver Manager by setting the BufferLength argument. BufferLength can have the following values: If ValuePtr is a pointer to a character string, then BufferLength is the length of the string or SQL_NTS. If ValuePtr is a pointer to a binary buffer, then the application places the result of the SQL_LEN_BINARY_ATTR(length) macro in BufferLength. This places a negative value in BufferLength. If ValuePtr is a pointer to a value other than a character string or binary string, then BufferLength should have the value SQL_IS_POINTER. If ValuePtr contains a fixed-length data type, then BufferLength is either SQL_IS_INTEGER or SQL_IS_UINTEGER, as appropriate. | |
StringLength | A pointer to a buffer in which to return the total number of bytes (excluding the null-termination character) available to return in ValuePtr. If ValuePtr is a null pointer, no length is returned. If the attribute value is a character string and the number of bytes available to return is greater than BufferLength minus the length of the null-termination character, the data in ValuePtr is truncated to BufferLength minus the length of the null-termination character and is null-terminated by the driver. | |
wszAttribute | The attribute to retrieve. |
Return value
The current value of the attribute.
Result code (GetLastResult)
SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_NO_DATA, SQL_ERROR, or SQL_INVALID_HANDLE.
Description
Returns the current setting of a connection attribute.
Reference
- Include file
CODBCDbc.inc - Defined in AfxNova/COdbcDbc.inc:207
- Documented in Databases/ODBC Classes/CODBC Class.md
- Topic: ODBC Classes