Databases Reference
In-Depth Information
This Database object declared is utilized to represent a database with at least one open connection.
It can be a Microsoft Access database as used in the examples in the text or an external data source
such as an Oracle database.
The DBEngine object is at the top of the DAO hierarchy. The DAO holds all other objects and
maintains all the database engine options. The common coding practice is to set a Workspace object
equal to the desired DBEngine. The default DBEngine Workspace is always indexed at zero, as is
shown in the following example:
Dim ws As DAO.Workspace
Set ws = DBEngine.Workspaces(0)
The Workspace object defines and manages the current user session. This object contains informa-
tion on open databases and provides mechanisms for simultaneous transactions.
The Recordset object is utilized for the extraction of a subset of data from the database.
Recordset objects represent a set of records defined by a query result.
Dim rs As DAO.Recordset
The TableDef object contains both Field and Index objects to describe the tables that reside in
the database. It is within the fields of the tables that all the information in a database is contained.
Dim tdef As DAO.TableDef
The QueryDef object represents a stored SQL query statement, with zero or more parameters,
maintained in a Microsoft database.
Dim qdf As DAO.QueryDef
The DAO model contains other objects that allow further manipulations to take place within a
database. Among them are
The Container object represents a particular set of objects in a database for which permissions
can be assigned in a secure workgroup. In addition to the Container objects provided by
DAO, an application may define its own Container objects (such as saved forms, modules,
reports, or script macros).
The Relation object represents a relationship between fields in tables and queries. The
Relation object can be used to create, delete, or change the type of relationship and to
determine which tables supply the fields that participate, whether to enforce referential
integrity, and whether to perform cascading updates and deletes.
The Field object represents a field in a table, query, index, relation, or record set. A Field
object contains data, and it can be used to read data from a record or write data to a record.
The Index object represents an index on a table in the database.
The Parameter object represents a value associated with a QueryDef object. Query param-
eters can be input, output, or both.
The Document object contains information about individual objects in the database (such
as tables, queries, or relationships).
Search WWH ::




Custom Search