Help Center

CODBC.SetConnectAttrmethod

Sets attributes that govern aspects of connections.

DatabasesmethodCODBCDbc.incdocumented

Syntax

FUNCTION SetConnectAttr (BYVAL Attribute AS SQLINTEGER, BYVAL ValuePtr AS SQLPOINTER, BYVAL StringLength AS SQLINTEGER) AS SQLRETURN
FUNCTION SetConnectAttr (BYREF wszAttribute AS WSTRING, BYVAL dwAttribute AS SQLUINTEGER) AS SQLRETURN
FUNCTION SetConnectAttr (BYREF wszAttribute AS WSTRING, BYREF wszAttrValue AS WSTRING) AS SQLRETURN

Parameters

NameDescription
AttributeAttribute to set, listed in "Comments."
ValuePtrPointer to the value to be associated with Attribute. Depending on the value of Attribute, ValuePtr will be a 32-bit unsigned integer value or will point to a null-terminated character string. Note that if the Attribute argument is a driver-specific value, the value in ValuePtr may be a signed integer.
StringLengthIf 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, StringLength is ignored.
If Attribute is a driver-defined attribute, the application indicates the nature of the attribute to the Driver Manager by setting the StringLength argument. StringLength can have the following values:
  • If ValuePtr is a pointer to a character string, then StringLength 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 StringLength. This places a negative value in StringLength.
  • If ValuePtr is a pointer to a value other than a character string or a binary string, then StringLength should have the value SQL_IS_POINTER.
  • If ValuePtr contains a fixed-length value, then StringLength is either SQL_IS_INTEGER or SQL_IS_UINTEGER, as appropriate.
wszAttributeAttribute to set.
dwAttributeThe value to set.
wszAttrValueThe value to set.

Return value

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR, SQL_INVALID_HANDLE, or SQL_STILL_EXECUTING.

The current value of the attribute.

Description

Sets attributes that govern aspects of connections.

Reference

  • Include file CODBCDbc.inc
  • Defined in AfxNova/COdbcDbc.inc:217
  • Documented in Databases/ODBC Classes/CODBC Class.md
  • Topic: ODBC Classes