Connection Object

Describes a database connection. Provides access to transactions. Controls creating and using stored procedures and direct queries in the SQL language. An instance of this object can be retrieved by using the OpenConnection method of the Workspace collection or from the Connections collection.

Properties

Name The name of the object for indentification in the collection.
DriverVersion The ODBC driver version.
ConformanceLevel The functionality level of the driver.
Transactions Transaction support level.
IsolationLevels A bit mask, describing available transaction isolation levels.
CursorTypes A bit mask that describes available cursors.

Methods

CreateQueryDef Creates a stored procedure in the SQL language. Returns a QueryDef object.
OpenRecordset Is used for executing direct queries and stored procedures in the SQL language. Returns the result of the query - a Recordset object.
CreateProperty Creates a Property object, that describes a user-defined property.
QueryDefs Provides access to the QueryDefs collection.
Recordsets

Provides access to the Recordsets collection.

Properties Provides access to the Properties collection.
BeginTrans Begins a transaction. All subsequent actions on the database will form part of this transaction.
CommitTrans Applies all database changes since BeginTrans was called.
RollbackTrans Ignores all changes in the database, occurred since BeginTrans was called. The database will be in the same state as before calling BeginTrans.
Close Breaks a database connection.

Remarks

The DriverVersion, ConformanceLevel, Transactions, IsolationLevels and CursorTypes properties contain information, relating only to the given connection and have the Read-Only attribute.

The SQL code of a QueryDef object, created with the CreateQueryDef method, will be input in the database in the form of a stored procedure after calling the Append method of the QueryDefs collection. It can be executed by using the OpenRecordset method, with the name of the QueryDef object as the parameter.

Using transactions at this level assumes that transactions are applied to the given object exclusively.

If the transaction hasn't been closed before calling the Close method, the CommitTrans function will be called automatically for the changes to come into force.

 

See Also

Connections Object, Property Object, Properties Object, QueryDef Object, QueryDefs Object, Recordset Object, Recordsets Object, Append Method, OpenConnection Method