• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Getting to Know DBEngine

As mentioned, the DBEngine object refers to the Jet Database Engine, which is at the top of the DAO hierarchy. The DBEngine object contains only two collections: Workspaces and Errors. When referring to the current database, you can use the CurrentDB() function discussed in the next section. When referring to any database other than the current database, you must refer to the DBEngine object, as in Listing 14.47.

Listing 14.47. Accessing the Properties of the DBEngine Object

Sub ReferToCurrentDB()
    Dim ws As dao.Workspace
    Dim db As dao.Database

    Set ws = DBEngine(0)

    'Point the Database object at a database
    'opened in the current workspace
    Set db = ws.OpenDatabase(CurrentProject.Path & "\Chap14Ex.mdb")

    'Print the version property of the database
    Debug.Print db.Version
End Sub


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint