Hi:
I'm using VB 6.0 with an Access 2000 database. I set the password in the
Access database to: abcdef1234. Then, using a MDIform, during the load
event, I send the program to a procedure to get some info out of the
database that has been password protected. I use the following code:
Public Sub GetSecInfo()
Dim secSQL As String, uName As String
Dim secRst As DAO.Recordset
Dim secDB As DAO.Database
Dim secRc As Integer, i As Integer
Set secDB = OpenDatabase(se cPath & "\Setup.mdb ", , False,
"pwd=jprobb4649 ")
My sql goes here.
Anyway, when the program gets to the "Set secDB" statement, I get an error
that says:
Error 3031 -- Not a valid password.
I've tried with and with the "pwd=" and that doesn't make any difference.
How do I set the password in the database and then open the password
protected database? I've seen it done in other programs using VB 6.0 and
Access 2000, but have never seen the code.
Thanks in advance for any assistance you can give me.
JP
I'm using VB 6.0 with an Access 2000 database. I set the password in the
Access database to: abcdef1234. Then, using a MDIform, during the load
event, I send the program to a procedure to get some info out of the
database that has been password protected. I use the following code:
Public Sub GetSecInfo()
Dim secSQL As String, uName As String
Dim secRst As DAO.Recordset
Dim secDB As DAO.Database
Dim secRc As Integer, i As Integer
Set secDB = OpenDatabase(se cPath & "\Setup.mdb ", , False,
"pwd=jprobb4649 ")
My sql goes here.
Anyway, when the program gets to the "Set secDB" statement, I get an error
that says:
Error 3031 -- Not a valid password.
I've tried with and with the "pwd=" and that doesn't make any difference.
How do I set the password in the database and then open the password
protected database? I've seen it done in other programs using VB 6.0 and
Access 2000, but have never seen the code.
Thanks in advance for any assistance you can give me.
JP
Comment