Describes a model of an open database. Controls transactions. Provides control over tables and links between tables. Allows to create and use stored procedures and direct SQL queries for controlling a database and getting information from it. An instance of this object can be retrieved by using the OpenDatabase method of the Workspace object or from the Databases collection.
Name | The name of the object for indentification in the collection. |
DriverVersion | The ODBC driver version. |
ConformanceLevel | The driver functionality level. |
Transactions | Transaction support level. |
IsolationLevels | A bit mask, describing available transaction isolation levels. |
CursorTypes | A bit mask that describes available cursors. |
CreateTableDef | Creates a new TableDef object, describing the data table. |
CreateQueryDef | Creates a stored procedure in the SQL language. Returns a QueryDef object. |
CreateRelation | Creates a Relation object, describing relationship between the tables. |
OpenRecordset | Creates and executes a direct SQL query. Can also execute stored procedures. Returns the result of the query - a Recordset object. |
CreateProperty | Creates a Property object, that describes a user-defined property. |
TableDefs | Provides access to the TableDefs collection. |
QueryDefs | Provides access to the QueryDefs collection. |
Recordsets | Provides access to the Recordsets collection. |
Relations | Provides access to the Relations 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. |
The DriverVersion, ConformanceLevel, Transactions, CursorTypes and IsolationLevels properties contain information, relating only to the given connection and have the Read-Only attribute.
After calling the CreateTableDef method the new table will be created in the database only after the TableDef object, describing the table, has been completely formed, all table fields have been created, and the Append method of the TableDefs collection has been called.
Similarly, information about new relations between the tables will be added to the database only after calling the Append method of the Relations collection.
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.