Click here to Skip to main content
15,891,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<add name="dbinfo" connectionstring="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\DB\DBInfo.accdb;Persist Security Info=True;Jet OLEDB:Database Password=arthdata123"> providerName="System.Data.OleDb" />

What I have tried:

when i was debug windows app with database error is comming.."Not a valid password". how can i properly run my windows app with password protected database file.

<configuration>
<configsections>

<connectionstrings>

<add name="dbinfo" connectionstring="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\DB\DBInfo.accdb;Persist Security Info=True;Jet OLEDB:Database Password=arthdata123">
providerName="System.Data.OleDb" />



Posted
Updated 4-Feb-16 23:28pm
v3
Comments
Anisuzzaman Sumon 5-Feb-16 5:57am    
which access database you are using (*.mdb) or (*.accdb)?
Arth01 8-Feb-16 3:47am    
*.accdb database
dan!sh 5-Feb-16 5:57am    
Have you provided correct password in connection string?
vipan.net 5-Feb-16 6:52am    
Kindly verify your password . if its verified. Kindly shared your connection string .

1 solution

Your ConnectionString should be as follows
If you are using .accdb(Access Office 2007)
C#
"Provider=Microsoft.ACE.OLEDB.12.0;Data source=yourDatabase.accdb;Jet OLEDB:Database Password=yourPassword"


Similarly if you are using *.mdb file your connectionstring should be look like as follows

C#
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=yourDatabase;
Jet OLEDB:Database Password=yourPassword;"
 
Share this answer
 
v2
Comments
Anisuzzaman Sumon 5-Feb-16 7:38am    
hey boss why down vote???
Richard MacCutchan 5-Feb-16 7:54am    
Idiots exist everywhere. I have countered with a +5.
BillWoodruff 5-Feb-16 18:51pm    
+5
Arth01 8-Feb-16 3:40am    
Thanks for reply
but also there was error coming "Not a valid password" then what can i do..

code in .config file is following..

<add name="dbinfo" connectionstring="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\DB\DBInfo.accdb;Jet OLEDB:Database Password=arthdata123" providername="System.Data.OleDb">
Anisuzzaman Sumon 8-Feb-16 8:32am    
You most welcome keya. :)

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