Cannot open password protected Access DB

N

nagar

I'm trying to open a password protected DB file using this c# code

string connString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=db1.mdb; Jet OLEDB:Database Password=andrea";

OleDbConnection conn = new OleDbConnection(connString);
conn.Open();

The DB is located in the debug folder of the application and the
password is andrea
If I open the DB from Microsoft Access it works fine.

Any idea of what I'm doing wrong?

I get an error telling me that the file doesn't exist. If I remove the
password from the DB and the Password intruction from the connection
string it works fine.

Shall I send you the protected DB1.mdb file?

Thanks.
Andrea
 
G

Göran Andersson

I'm trying to open a password protected DB file using this c# code

string connString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=db1.mdb; Jet OLEDB:Database Password=andrea";

OleDbConnection conn = new OleDbConnection(connString);
conn.Open();

The DB is located in the debug folder of the application and the
password is andrea
If I open the DB from Microsoft Access it works fine.

Any idea of what I'm doing wrong?

I get an error telling me that the file doesn't exist. If I remove the
password from the DB and the Password intruction from the connection
string it works fine.

Shall I send you the protected DB1.mdb file?

Thanks.
Andrea

You may need to supply the user name along with the password in the
connection string. The user name is "Admin".
 
N

nagar

Thanks for the suggestion but I'm still experiencing the same problem

string connString =
@"Provider=Microsoft.Jet.OLEDB.4.0;Password=andrea;User
ID=Admin;DataSource=db1.mdb";

I'm attaching the DB (password: andrea).
Thanks.
Andrea
 
N

nagar

Thanks for the suggestion but I'm still experiencing the same problem

string connString =
@"Provider=Microsoft.Jet.OLEDB.4.0;Password=andrea;User
ID=Admin;DataSource=db1.mdb";

I'm attaching the DB (password: andrea).
Thanks.
Andrea
 
N

nagar

Thanks for the suggestion but I'm still experiencing the same problem

I've used:

string connString =
@"Provider=Microsoft.Jet.OLEDB.4.0;Password=andrea;User
ID=Admin;DataSource=db1.mdb";

Can I send you the DB to test?

Thanks.
Andrea
 
N

nagar

Thanks for the suggestion but I'm still experiencing the same problem

I've used:

string connString =
@"Provider=Microsoft.Jet.OLEDB.4.0;Password=andrea;User
ID=Admin;DataSource=db1.mdb";

Can I send you the DB to test?

Thanks.
Andrea
 
G

Göran Andersson

Thanks for the suggestion but I'm still experiencing the same problem

string connString =
@"Provider=Microsoft.Jet.OLEDB.4.0;Password=andrea;User
ID=Admin;DataSource=db1.mdb";

I'm attaching the DB (password: andrea).
Thanks.
Andrea

You don't need to post the same reply four times, I am capable of
reading something that is posted only once.

Try changing "DataSource" to "Data Source".
 
N

nagar

I'm sorry about the multiple post. I had trouble uploading the test db
and the message was sent many times.
I'm sending you the project (in VS2008) by email. Would you be so kind
to have a look and see why it doesn't work.
I really appreciate that. Thanks so much!
Andrea
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top