asp.net连接Access2007路径设置
                                2011-1-5 12:27:51 - tanlixiao
                           
                           
                          asp.net连接Access2007数据库时的路径设置,数据库文件可放在App_Data文件夹中
Access 2007连接字符串,Access 数据库链接字符串的几种方式
Access 
2007以下是语法格式:
Provider=Microsoft.ACE.OLEDB.12.0;Data 
Source=C:\myFolder\myAccess2007file.accdb;Persist Security Info=False;
Access 以下是语法格式:
Access 以下是语法格式:
Provider=Microsoft.ACE.OLEDB.12.0;Data 
Source=C:\myFolder\myAccess2007file.accdb;Jet OLEDB:Database Password=MyDbPassword;
Access 
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\myAccess2007file.accdb;Persist Security Info=False;
Access 以前的连接字符串
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\1.mdb;User ID=admin;Password=;Jet OLEDB
在web.config中配置如下:
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\myAccess2007file.accdb;Persist Security Info=False;
Access 以前的连接字符串
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\1.mdb;User ID=admin;Password=;Jet OLEDB
在web.config中配置如下:
<connectionStrings>
  <add name="conStr" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;
    Data Source=|DataDirectory|\NewsManage.accdb;Persist Security Info=True" 
     providerName="System.Data.OleDb"/>
</connectionStrings>app.comfig中|DataDirectory|会被自动解析到Bin目录下
标签:access路径