[英]Vb.net Connection String for Ms Access Database
在VB.net中用于连接MS Access 2010(.accdb)数据库的连接字符串是什么。
connectionstrings.com is a wonderful thing : connectionstrings.com是一件了不起的事情 :
Standard security
标准安全
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\myFolder\\myAccess2007file.accdb;Persist Security Info=False;
Provider = Microsoft.ACE.OLEDB.12.0;数据源= C:\\ myFolder \\ myAccess2007file.accdb;持久性安全信息= False;
With database password
带数据库密码
This is the connection string to use when you have an Access 2007 database protected with a password using the "Set Database Password" function in Access.
这是当您使用Access中的“设置数据库密码”功能使用密码保护Access 2007数据库时使用的连接字符串。
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\myFolder\\myAccess2007file.accdb;Jet OLEDB:Database Password=MyDbPassword;
Provider = Microsoft.ACE.OLEDB.12.0;数据源= C:\\ myFolder \\ myAccess2007file.accdb; Jet OLEDB:Database Password = MyDbPassword;
Some reports of problems with password longer than 14 characters.
某些有关密码长度超过14个字符的问题的报告。 Also that some characters might cause trouble.
还有一些字符可能会引起麻烦。 If you are having problems, try change password to a short one with normal characters.
如果遇到问题,请尝试将密码更改为短密码,并使用正常字符。
DataDirectory functionality
DataDirectory功能
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\\myAccess2007file.accdb;Persist Security Info=False;
Provider = Microsoft.ACE.OLEDB.12.0; Data Source = | DataDirectory | \\ myAccess2007file.accdb; Persist Security Info = False;
您可以使用Visual Studio的Server Explorer
来获取连接字符串或查看连接字符串。
www.connectionstrings.com www.connectionstrings.com
this is a good site for connection strings for almost any application 这是几乎所有应用程序都可以使用连接字符串的好地方
Did you connect to the database by using 'Tools->Connect to database' ? 您是否通过使用“工具->连接到数据库”连接到数据库?
If you have already done the above, try this: 如果您已经完成上述操作,请尝试以下操作:
Go to server explorer. 转到服务器资源管理器。 And select connected database -> In its properties there is a connection string -> Copy it and paste into your code.
然后选择连接的数据库->在其属性中有一个连接字符串->复制它并粘贴到您的代码中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.