VB访问数据库密码不会传递给应用程序 [英] VB access db password doesnt pass on to application
问题描述
i我正在尝试使用vb 2010构建一个win表单应用程序
并且有一个受密码保护的.mdb数据库并且是应用程序中的数据源意味着连接字符串是只读的,如果我想更改它,我应该修改服务器资源管理器中的连接。
问题是我在服务器资源管理器中修改连接(设置密码)然后测试连接和它说没有问题,工作正常。我可以在vb中更改查询和所有内容。
但是当我尝试构建应用程序时出现此错误:
{ 无效密码。}
尝试持久保密信息真假但没有运气
i 100%确定连接的属性是正确的但问题是vb没有把密码放在连接字符串中
我该怎么办?
tnx提前
找到了它!
u应修改连接在这样的程序开始时:
私人 Sub Form1_Load(发件人作为 对象,e 作为 System.EventArgs)句柄 我 .Load
我的。 Settings.Item( ConnectionStringName)= TheConnectionString;
结束 Sub
Hi,
i am trying ti build a win forms application with vb 2010
and have a .mdb database which is password protected and is a data source in app which means connection string is read only and if i want to change it, i should modify connection in server explorer.
the problem is i modify connection (set password) in server explorer and then test the connection and it say there is no problem and works ok. i can change query and everything in vb.
but when i try to build the app there is this error :
{"Not a valid password."}
tried persist security info true and false but no luck
i am 100% sure the properties of connection are right but the problem is vb doesnt put password in the connection string
what should i do ?
tnx in advance
found it !
u should modify connection on start of the program like this :
Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load My.Settings.Item("ConnectionStringName") = "TheConnectionString;" End Sub
这篇关于VB访问数据库密码不会传递给应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!