| | |
Connecting password protected MS Access database from C#
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2007
Posts: 3
Reputation:
Solved Threads: 0
Hi,
I have an MS Access database which has password. Now I can open the database using the password from MS Access, but when I try to test connection from Visual Studio Connection String Settings Design Time Windows Form, I get message that "Not a valid password". Still, I tried to connect to that password protected MS Access database from C# using the connection string with password, and then when I run the application, I get Database Connection error message. Is there anything I am missing ? Would you please help me.
Thanks.
I have an MS Access database which has password. Now I can open the database using the password from MS Access, but when I try to test connection from Visual Studio Connection String Settings Design Time Windows Form, I get message that "Not a valid password". Still, I tried to connect to that password protected MS Access database from C# using the connection string with password, and then when I run the application, I get Database Connection error message. Is there anything I am missing ? Would you please help me.
Thanks.
I have a few questions?
Standard security with ODBC should look like this for other versions of Access.
Standard security with OLEDB should look like this.
And with just a database password, the OLEDB connection string should look like this:
- What version of Access?
- Are you using OLEDB or ODBC?
- Can you post your connection string?
C# Syntax (Toggle Plain Text)
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\mydb.accdb;Jet OLEDB:Database Password=password;
C# Syntax (Toggle Plain Text)
Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;Uid=Admin;Pwd=password;
C# Syntax (Toggle Plain Text)
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydb.mdb;User Id=admin;Password=password;
C# Syntax (Toggle Plain Text)
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydb.mdb;Jet OLEDB:Database Password=password;
The truth does not change according to our ability to stomach it.
•
•
Join Date: Jul 2007
Posts: 3
Reputation:
Solved Threads: 0
Hi Hamrick,
Thanks a lot for your help. Finally I found the problem, I changed my password and now it was working. So, I am assuming that, Ms Access cant take longer than a certain length password or some special character or maybe something else. But I am happy, my new password is working now.
Regards
Emran
Thanks a lot for your help. Finally I found the problem, I changed my password and now it was working. So, I am assuming that, Ms Access cant take longer than a certain length password or some special character or maybe something else. But I am happy, my new password is working now.

Regards
Emran
That's funky. I looked around and found application limits for access 97 and 2000. I guess they're the same or better for newer versions, and if they're better it's probably a good idea to assume they're not for compatibility.
Access 97:
MS Access 2000:
If not it probably had some special characters that access doesn't like.
Access 97:
- Max mdb file size: 1GB
- Max objects in database: 32768
- Max modules in database: 1024
- Max object name length: 64
- Max password length: 14
- Max user/group name length: 20
- Max users connected to database: 255
- Max record length (without Memos and BLOBs): 2048
- Max fields in table: 255
- Max nested transactions: 7
MS Access 2000:
- Max mdb file size: 2GB
- Max table size: 1GB
- Max objects in database: 32768
- Max modules in database: 1000
- Max object name length: 64
- Max password length: 14
- Max user/group name length: 20
- Max users connected to database: 255
- Max record length (without Memos and BLOBs): 2048
- Max fields in table: 255
If not it probably had some special characters that access doesn't like.
The truth does not change according to our ability to stomach it.
•
•
Join Date: Jul 2007
Posts: 3
Reputation:
Solved Threads: 0
Hi,
Thanks again,.
I am still confused about a matter. If my password was longer than 14 characters, then anytime ACCESS should not have accepted the password, right ? But I could easily open the MS Access using that old password directly from the MS ACCESS application itself. But when I tried to connect to the same database using the same password thru the ConnectionString from C# Windows Application, I used to get "Not a valid password.". Is it supposed to be different for one in MS Access application (itself) and another from external application connection !!
Anyway, I appreciate your helps.
Regards
Emran
Thanks again,.
I am still confused about a matter. If my password was longer than 14 characters, then anytime ACCESS should not have accepted the password, right ? But I could easily open the MS Access using that old password directly from the MS ACCESS application itself. But when I tried to connect to the same database using the same password thru the ConnectionString from C# Windows Application, I used to get "Not a valid password.". Is it supposed to be different for one in MS Access application (itself) and another from external application connection !!
Anyway, I appreciate your helps.
Regards
Emran
•
•
•
•
I used to get "Not a valid password."
The truth does not change according to our ability to stomach it.
![]() |
Similar Threads
- Help me in username and password validation through accessing the database (ASP.NET)
- Help, How to write 30 days validation procedure? (Visual Basic 4 / 5 / 6)
- Creating login screens in VB6 (Visual Basic 4 / 5 / 6)
- Database Synchronization (MS Access and FileMaker Pro)
Other Threads in the C# Forum
- Previous Thread: cpu utilization
- Next Thread: skinning ASP Forums
| Thread Tools | Search this Thread |
.net access algorithm alignment app array barchart bitmap box broadcast c# c#gridviewcolumn cast check checkbox client combobox communication concurrency control conversion csharp custom database datagrid datagridview dataset datatable datetime degrees development draganddrop drawing elevated encryption enum excel file focus form format forms function gdi+ hospitalmanagementsystem image index input install java label list listbox localization login mandelbrot math messagebox mouseclick mysql operator path photoshop picturebox pixelinversion plotting pointer post programming radians read regex remote remoting richtextbox server sleep socket sql statistics stream string stringformatting sun table text textbox thread time timer update usercontrol validation visualstudio webbrowser whileloop windows winforms wpf xml





