ODBCDatabase.ConnectionAttribute

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!
Method

ODBCDatabase.ConnectionAttribute(attributeID as Integer) As Variant

New in 2019r2

Supported for all project types and targets.

Gets and sets the current setting of a connection attribute. Returns a Variant that contains either a String or an Integer, based on the attribute.

Notes

The attribute can be specified using the ODBCConstant constants. The value is only set after the connection is made. Only Integer attributes may be set with this method. To set a String attribute before the connection is made, see the Attribute property.

Microsoft provides additional information about the SQLGetConnectAttr ODBC function.

Example

Obtaining an attribute:

Var currentCatalog As Variant
currentCatalog = db.ConnectionAttribute(ODBCConstant.SQL_CURRENT_QUALIFIER)

Setting an attribute to disable AutoCommit:

db.ConnectionAttribute(ODBCConstant.SQL_AUTOCOMMIT) = ODBCConstant.SQL_AUTOCOMMIT_OFF