CodeDb()

If your Wizard relies on tables that are stored in the Wizard library database (perhaps for storing localizable strings), you will need to distinguish between your library database and the user's database in order to refer to your tables. You do this with the CodeDB() function. Here's an example that gets an error string from a table named Errors in the library database.


Function GetErrorString (ByVal MyIndex As Integer) As String
    Dim MyLibDb As Database, MyTable As RecordSet
    Set MyLibDb = CodeDB()
    Set MyTable = MyLibDb.OpenRecordSet("Errors", DB_OPEN_TABLE)
    MyTable.Index = "ErrorID"
    MyTable.Seek "=", MyIndex
    GetErrorString = MyTable.TheData
    MyTable.Close
End Function