将MS Access 2003 DB WITH PASSWORD连接到Visual Studio 2008中的Winform应用程序 [英] connecting ms access 2003 DB WITH PASSWORD to winform app in visual studio 2008

查看:60
本文介绍了将MS Access 2003 DB WITH PASSWORD连接到Visual Studio 2008中的Winform应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,
我正在使用具有密码(数据库密码,而不是工作组或smth)的MS Access数据库.
我使用的是13个字符-没有特殊标志-只是字母.
当我尝试通过访问打开数据库时,它工作正常,但是当我尝试从Visual Studio连接字符串运行Windows窗体应用程序时,出现一条消息无效密码".

在app.config中,我使用它作为连接字符串:

[CODE] <  连接字符串 > 
<  添加    ="   esystem.my.settings.esystemdbconnectionstring"   连接字符串  ="    提供商名称  ="  span> / > 
<  /connectionstrings  > 
[/代码]

顺便说一句,如果我未在ACCESS DB中设置密码,则连接字符串可以正常工作.
任何人都不知道可能是什么问题?

谢谢.

解决方案

我认为您需要指定

< connectionstrings>
< add name = "  connectionstring =   Provider = Microsoft.Jet.OLEDB.4.0; Data Source = | DataDirectory | \ esystem.mdb; Jet OLEDB:< b>< u> ; User ID:Administrator;</u></b>数据库密码= abcd;" providername =  />
</ 连接字符串 >  


请检查一下.

因为在通过VS连接到MS Access DB时,我们需要用户名和密码.

因此,请检查您的MS Access DB用户名

还有另一种方法.创建一个udl文件并从那里设置连接.您将获得连接字符串.

如果对您有帮助,请接受答案.


请验证是否用实际的密码替换了 abcd ,因为类似的语句在受密码保护的Access数据库中运行得很好. /blockquote>

Hi,
I'm using an MS Access database which has password (database password, not a workgroup or smth).
I'm using 13 characters - with no special signs- only letters.
When I try to open the DB from access it works fine, but when I try to run my Windows Form application from Visual Studio Connection String, I get a message that "Not a valid password".

In the app.config, I'm using this for connection string:

[CODE]<connectionstrings>
<add name="esystem.my.settings.esystemdbconnectionstring" connectionstring="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\esystem.mdb;Jet OLEDB:Database Password=abcd;" providername="system.data.oledb"/>
</connectionstrings>
[/CODE]

by the way, if I unset the password in my ACCESS DB, the connection string works perfect.
anywone have any idea what might be the problem?

Thanks.

解决方案

I Think You Need To Specify The

<connectionstrings>
<add name="esystem.my.settings.esystemdbconnectionstring" connectionstring="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\esystem.mdb;Jet OLEDB:<b><u>User ID:Administrator;</u></b>Database Password=abcd;" providername="system.data.oledb" />
</connectionstrings>


Please Check That.

Because While Connecting To MS Access DB Through VS We Need The User Name And Password.

So Check The User Name For Your MS Access DB

Also There Is Another Method. Create A udl File And Set The Connection From There. You Will Get The Connection String.

Accept The Answer If It Has Helped You


Please verify whether abcd is replaced with actual password, because similar statement is working well with my password protected Access Database.


这篇关于将MS Access 2003 DB WITH PASSWORD连接到Visual Studio 2008中的Winform应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆