日期:2014-05-18  浏览次数:20453 次

asp.net 2005 连接 access
我这个是在类里写的 提示上下文中没Server 
string s = String.Format("Provider={0};Data Source={1}", System.Configuration.ConfigurationManager.AppSettings["provider"], Server.MapPath(System.Configuration.ConfigurationManager.AppSettings["datasource"]));

那应当如何写

谢谢了

------解决方案--------------------
楼主输入 S看看具体内容不就可以了? 使用Server.MapPath 在不同路径下得到的内容是不一样的

OLE DB, OleDbConnection (.NET)

Standard security 
  
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;User Id=admin;Password=; 
 

 

------解决方案--------------------
如果是 ACCESS2007 链接字符串如下

Standard security 
  
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Persist Security Info=False;