在C#中打开受密码保护的MDB文件 [英] Open a password protected MDB File in C#
本文介绍了在C#中打开受密码保护的MDB文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好专家,
打开受密码保护的MDB文件的连接字符串将是什么.
我正在使用.NET OleDbConnection类打开此文件.
我能够打开一个不受保护的MDB文件,并对其执行所需的操作.
Prateek.
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.
推荐答案
只需将您的连接字符串修改为
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 + ";";
更改变量 strFile 和 strPass ,然后像现在一样休息.
欢呼
Praveen.
change the variable strFile and strPass, and rest do as you do now.
cheers
Praveen.
看看这个:
http://www.online-tech-tips.com /ms-office-tips/ms-access-to-sql-database/ [ Microsoft SQL Server 2008 R2 Express是SQL Server的免费版本 [ ^ ]-您甚至可以在其中包含SQL Server Express您的解决方案.
如果可以的话-摆脱整个mdb的事情-浪费时间和精力...
如果需要在多个服务器之间同步数据,请查看以下内容:
SQL Server复制 [
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
这篇关于在C#中打开受密码保护的MDB文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文