Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello Experts,

What will be the connection string for opening a password protected MDB file.

I am using .NET OleDbConnection class, for opening this file.

I am able to open a unprotected MDB file, and do required operations on it.

Prateek.
Posted
Updated 26-Feb-11 1:14am
v2

Just modify your connection string as


string strFile = "D\\WORKS\\MyData.mdb";
string strPass ="MDBPassword";

string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + strFile + ";Jet OLEDB:Database Password=" + strPass + ";";


change the variable strFile and strPass, and rest do as you do now.

cheers


Praveen.
 
Share this answer
 
Comments
Espen Harlinn 26-Feb-11 6:40am    
Try that in a 64-bit environment :-( no joy
Take a look at this:
http://www.online-tech-tips.com/ms-office-tips/ms-access-to-sql-database/[^]

Microsoft SQL Server 2008 R2 Express is a free edition of SQL Server[^] - you can even include SQL Server Express along with your solution.

If you can - get rid of the whole mdb thing - it's a waste of time and effort ...

If you need to synchronize data between multiple servers, take a look at this:
SQL Server Replication[^]

Regards
Espen Harlinn
 
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