DBEngine Object

             

The DBEngine object is the top level object in the DAO object model.

objdbeng

parmultcolworks

parchildcolerror

Remarks

The DBEngine object contains and controls all other objects in the hierarchy of DAO objects. You can't create additional DBEngine objects, and the DBEngine object isn't an element of any collection.

Note When you reference an ODBC data source directly through DAO, it is called an "ODBCDirect workspace." This is to distinguish it from an ODBC data source that you reference indirectly through the Microsoft Jet database engine, using a "Microsoft Jet workspace."  Each method of accessing ODBC data requires one of two types of Workspace object; you can set the DefaultType property to choose the default type of Workspace object that you will create from the DBEngine object. The Workspace type and associated data source determines which DAO objects, methods, and properties you can use.

With any type of database or connection, you can:

?Use the Version property to obtain the DAO version number.

 

?Use the LoginTimeout property to obtain or set the ODBC login timeout, and the RegisterDatabase method to provide ODBC information to the Microsoft Jet database engine. You can use these features the same way, regardless of whether you connect to the ODBC data source through Microsoft Jet or through an ODBCDirect workspace.

 

?Use the DefaultType property to set the default type of database connection that subsequently created Workspace objects will use — either Microsoft Jet or ODBCDirect.

 

?Use the DefaultPassword and DefaultUser properties to set the user identification and password for the default Workspace object.

 

?Use the CreateWorkspace method to create a new Workspace object. You can use optional arguments to override the settings of the DefaultType, DefaultPassword, and DefaultUser properties.

 

?Use the OpenDatabase method to open a database in the default Workspace, and use the BeginTrans, Commit, and Rollback methods to control transactions on the default Workspace.

 

?Use the Workspaces collection to reference specific Workspace objects.

 

?Use the Errors collection to examine data access error details.

Other properties and methods are only available when you use DAO with the Microsoft Jet database engine. You can use them to control the Microsoft Jet database engine, manipulate its properties, and perform tasks on temporary objects that aren't elements of collections. For example, you can:

?Use the CreateDatabase method to create a new Microsoft Jet Database object.

 

?Use the Idle method to enable the Microsoft Jet database engine to complete any pending tasks.

 

?Use the CompactDatabase and RepairDatabase methods to maintain database files.

 

?Use the IniPath and SystemDB properties to specify the location of Microsoft Jet Windows Registry information and the Microsoft Jet workgroup information file, respectively.  The SetOption method allows you override windows registry settings for the Microsoft Jet database engine.

After you change the DefaultType and IniPath property settings, only subsequent Workspace objects will reflect these changes.

Note For a complete list of all methods, properties, and collections available on the DBEngine object, see the Summary topic.

To refer to a collection that belongs to the DBEngine object, or to refer to a method or property that applies to this object, use this syntax:

[DBEngine.][collection | method | property]