DAO OpenDatabase accdb file - Not a valid password

kt1978

Registered User.
Local time
Today, 06:13
Joined
Jan 15, 2011
Messages
43
Hi

I've change my db to a accdb file and in my Excel (xlsm) file I am trying to use the open database (DAO method)

I've changed the reference to:
Microsoft Office 15.0 Access database engine

It was working fine until I added a password to the database

Here is the code:
Code:
Set db = OpenDatabase(strDBPath, False, False, "MS Access;PWD=" & strPassword)

This code works fine when I had the Microsoft DAO 3.6 Object Library

Is there something simple I'm missing with this?

Thanks
 
Hi

I thought I had this working but it isn't working when I have a password on the database

The password is correct as I can open it manually


I'm getting the error message "Not a valid password"

Code:
  Dim wrkspc As DAO.Workspace
  Set wrkspc = DBEngine(0)
  Set db = wrkspc.OpenDatabase(GetDatabaseName, False, False, ";pwd=password")

It works fine if I remove the password!

any ideas. I've searched around and it looks like all the syntax is correct.

Thanks in advance
 
I haven't used this in a while, but does the same password work when you manually open the db?
And it's being opened Access 2013 right?
What version is the db itself?
 
Hi

Yes password is correct and opens fine manually

The database has been converted to 2013 format. (accdb)
 
Alright, try changing the encryption type. Make it use Legacy.

Open the db > go to Options > Client Settings > look for Encryption and change that to Legacy > close and reopen the db. Close it and try the password again.
 
Hmmm... Microsoft haven't sorted out this issue.

You're welcome!
 

Users who are viewing this thread

Back
Top Bottom