OpenDatabase Method Example

This example opens the Nwindex.mdb database if it’s found in the default file path.

Dim db As Database
ChDir Application.DefaultFilePath
a = Dir("NWINDEX.MDB")
If a = "" Then
    MsgBox "NWINDEX.MDB not found"
    Exit Sub
End If
Set db = Workspaces(0).OpenDatabase(a)
MsgBox "NWINDEX.MDB is now open"
' use database here
db.Close