Click here to Skip to main content
15,670,482 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
One of the apps I've been developing is next to done...and up until now I've used the Access database without specifying a password. But, for the final version, I want it to be secured with one...The problem is, I've tried setting a password in Access, it's ok....Then added the database within my project with the wizard in VStudio, but even if the connection test is ok, when trying to runn the app I get an error like "Not a valid password".
Any Ideas? The password i used is something like "aaaaaBbbbb", only literals, no numerals.
Updated 29-Mar-10 1:08am

Just as an FYI, access system passwords aren't all that secure. You can easily and quickly download a free utility to show the passwords in any Access database. They're very east to get into. If you want an example see hereL Download Access Password Retrieval LITE[^]

Just as an example's one way to provide the password:
connectionString = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" +
                                             "DataSource=" + dbLocation +
                                             ";Jet OLEDB:Database Password=" + password)

You'd be better off encrypting the file and decrypting it when you want to use it. An example at: How to encrypt and decrypt a file by using Visual C#[^]
Share this answer
You put the password in the connection string.
Share this answer
As always, the answer to DB connection questions should be right here[^].

Share this answer
Looks like where ever you are setting the password, it's not getting saved. If there is an option to save password then use it. Or else you have to supply password using other ways... one already suggested by CG
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900