kevinnichols78
Board Regular
- Joined
- Aug 30, 2004
- Messages
- 112
Hi all,
I'm trying to open a database from another database. The one I'm trying to open is protected with a password. As I understand it, this code should work:
Sub Begin()
Dim wsp As Workspace
Dim dbs As Database, dbsAnother As Database
Dim tdf As TableDef
' Return reference to current database.
Set dbs = CurrentDb
' Return reference to default workspace.
Set wsp = DBEngine.Workspaces(0)
' Return reference to Another.mdb.
Set dbsAnother = wsp.OpenDatabase("C:\Data.mdb", , , "ODBC;PWD=password")
However, it doesnot. It finds the database and tries to open it, but gives me a password invalid message. Now I know that that password is correct because I can type it in and it will open the database. SO, any other ideas?
Kevin
I'm trying to open a database from another database. The one I'm trying to open is protected with a password. As I understand it, this code should work:
Sub Begin()
Dim wsp As Workspace
Dim dbs As Database, dbsAnother As Database
Dim tdf As TableDef
' Return reference to current database.
Set dbs = CurrentDb
' Return reference to default workspace.
Set wsp = DBEngine.Workspaces(0)
' Return reference to Another.mdb.
Set dbsAnother = wsp.OpenDatabase("C:\Data.mdb", , , "ODBC;PWD=password")
However, it doesnot. It finds the database and tries to open it, but gives me a password invalid message. Now I know that that password is correct because I can type it in and it will open the database. SO, any other ideas?
Kevin