FancyPrairie
Programmer
I'm trying to retrieve the names of all of the tables and queries from another database (database A) using ADOX. It works fine if database A is not password protected. If it's password protected then it crashes with the "Don't Send" message. The connection string contains the name of the mdw file and the user id and password, I don't understand why it crashes if the db is password protected.
To test it, first create a database (LibraryDatabase.mdb), create a new modulue and copy and paste fooLib into the new module.
LibraryDatabase.mdb
Note the Stop statement. You should be able to see the values of cat (i.e. cat.tables, etc).
Step 2: Create an unsecured database, and create a new module and insert the following code into it. Then set a Reference to the LibraryDatabase.mdb. Then run the following code. When it stops you should be able to examine cat.tables, etc.
TestDatabase_Unsecured.mdb
Set a reference to LibraryDatabase.mdb
Step 3: Create an secured database, and create a new module and insert the following code into it. Then set a Reference to the LibraryDatabase.mdb. Then run the following code. When it stops it should crash when you attempt to examine cat.tables, etc.
TestDatabase_Secured.mdb
Set a reference to LibraryDatabase.mdb
To test it, first create a database (LibraryDatabase.mdb), create a new modulue and copy and paste fooLib into the new module.
LibraryDatabase.mdb
Code:
Function fooLib()
Dim cnn As ADODB.Connection
Dim cat As ADOX.Catalog
Set cnn = New ADODB.Connection
Set cat = New ADOX.Catalog
Set cnn = CurrentProject.Connection
Set cat.ActiveConnection = cnn
Stop
End Function
Note the Stop statement. You should be able to see the values of cat (i.e. cat.tables, etc).
Step 2: Create an unsecured database, and create a new module and insert the following code into it. Then set a Reference to the LibraryDatabase.mdb. Then run the following code. When it stops you should be able to examine cat.tables, etc.
TestDatabase_Unsecured.mdb
Set a reference to LibraryDatabase.mdb
Code:
Function foo()
Call fooLib
End Function
Step 3: Create an secured database, and create a new module and insert the following code into it. Then set a Reference to the LibraryDatabase.mdb. Then run the following code. When it stops it should crash when you attempt to examine cat.tables, etc.
TestDatabase_Secured.mdb
Set a reference to LibraryDatabase.mdb
Code:
Function foo()
Call fooLib
End Function