rod
Jun 8th, 2000, 10:27 AM
hi! how can u connect ADO with a password protected MS ACCESS97 . i've been using DAO 3.51 with the following code:
Dim MyWS as Workspace
Dim MyDB as Database
Dim MyTable as Recordset
Set MyWS=DBEngine.Workspaces(0)
'*** Here's how to open a database with password ***
Set MyDB=MyWS.OpenDatabase("C:\MyMDB.MDB",False,False, _
"MS ACCESS;PWD=MyPassword")
this code works without a problem. but when i use ADO with the following code:
strconn = "Provider=Microsoft.Jet.OLEDB.3.51;Data" & _
"Source=C:\MyMDB.MDB;" & _
"User ID=Admin;Password=MyPassword;"
Set cnMyCon = New ADODB.Connection
cnMyCon.Open strconn
it gave me this error:
Run-Time Error '-2147467259(80004005)
Can't start your application. The workgroup information file is missing or opened exclusively by another user.
there's no one accessing the MyMDB database, therefore it's not exclusively opened and i'm not using any workgroup information file (system.mdw) in my previous codes (using DAO 3.51).
what am i missing. i'll appreciate any help
thanks
rod
Dim MyWS as Workspace
Dim MyDB as Database
Dim MyTable as Recordset
Set MyWS=DBEngine.Workspaces(0)
'*** Here's how to open a database with password ***
Set MyDB=MyWS.OpenDatabase("C:\MyMDB.MDB",False,False, _
"MS ACCESS;PWD=MyPassword")
this code works without a problem. but when i use ADO with the following code:
strconn = "Provider=Microsoft.Jet.OLEDB.3.51;Data" & _
"Source=C:\MyMDB.MDB;" & _
"User ID=Admin;Password=MyPassword;"
Set cnMyCon = New ADODB.Connection
cnMyCon.Open strconn
it gave me this error:
Run-Time Error '-2147467259(80004005)
Can't start your application. The workgroup information file is missing or opened exclusively by another user.
there's no one accessing the MyMDB database, therefore it's not exclusively opened and i'm not using any workgroup information file (system.mdw) in my previous codes (using DAO 3.51).
what am i missing. i'll appreciate any help
thanks
rod