Home > Database > Mysql Tutorial > 用C#访问ACCESS数据库问题

用C#访问ACCESS数据库问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:22:06
Original
945 people have browsed it

最近这个项目中用到是ACCESS的数据库,开始没有使用密码进行连接: String connectionString = Provider=Microsoft.Jet.OleDb.4.0;Data Source=; connectionString += @c:datadbdb.mdb; OleDbConnection con = new OleDbConnection(connectionString); con.O

最近这个项目中用到是ACCESS的数据库,开始没有使用密码进行连接:

String connectionString = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=";
connectionString += @"c:datadbdb.mdb";
OleDbConnection con = new OleDbConnection(connectionString);

con.Open();

是没有任何问题。

为了要使数据库安全一点,,不能被用户直接打开编辑,所以想到给Access数据库设置个密码:从菜单“工具”->"安全"->"设置数据库密码",这样设置后就不能正常访问这个数据库了,在连接字符串中加上User ID与Password字段还是不行。最后在"工具"->"安全"->"用户与组的账户"设置好密码,直接不用更改连接字符串就可以连接了。这样处理后,用户打开时提示需要输入密码,也就达到了保护Access库的目的

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template