IIS7下使用ASP.NET连接ACCESS数据库时提示如下错误怎么办

这是由于我们使用的Win2008系统是64位的,以前Win2003是32位的系统 。
/应用程序中的服务器错误 。
【IIS7下使用ASP.NET连接ACCESS数据库时提示如下错误怎么办】未在本地计算机上注册microsoft.jet.oledb.4.0提供程序 。
这是由于我们使用的Win2008系统是64位的,以前Win2003是32位 。按以下解决方法:
1、修改连接数据库的代码:
如原代码是
DataPath = App_Data/#data.mdb;
String constring = provider=microsoft.jet.oledb.4.0;data source= + HttpContext.Current.Server.MapPath(DataPath) + ;
修改后的是:
DataPath = App_Data/#data.mdb;
string constring = provider=Microsoft.ACE.OLEDB.12.0;data source= + HttpContext.Current.Server.MapPath(DataPath) + ;
注意:只需要修改为红色字体部份,其它的不用修改 。也就是换一种连接数据库的驱动

IIS7下使用ASP.NET连接ACCESS数据库时提示如下错误怎么办的详细内容就为您分享到这里,【精彩生活】jing111.com小编为您精选以下内容,希望对您有所帮助: