2014-02-12 29 views
0

如何在下文提到的连接字符串添加密码如何添加密码的连接字符串

<connectionStrings> 
    <add name="Gate_App.My.MySettings.GateDbConnectionString1" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\GateDb.accdb;Persist Security Info=True " 
     providerName="System.Data.OleDb" /> 
</connectionStrings> 
+0

http://www.connectionstrings.com/ace-oledb-12-0/with-database-password/ –

回答

0

使用此 <connectionStrings> <add name="Gate_App.My.MySettings.GateDbConnectionString1" connectionString=" Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\GateDb.accdb; User ID=*******; Password='*******';Persist Security Info=True " providerName="System.Data.OleDb" /> </connectionStrings>

0

试试这个,

<add name="Gate_App.My.MySettings.GateDbConnectionString1" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\GateDb.accdb;User Id=id;Password=pass;" providerName="System.Data.OleDb"/
0
<connectionStrings> 
    <add name="Gate_App.My.MySettings.GateDbConnectionString1" connectionString="Provider=Microsoft.ACE.OLEDB.12.0; 
Data Source=|DataDirectory|\GateDb.accdb;Persist Security Info=True;User ID=myUsername;Password=myPassword;" 
      providerName="System.Data.OleDb" /> 
    </connectionStrings> 

Access connection strings