ODBCDatabase.ConnectionAttribute

From Xojo Documentation

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.

References

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