IIS7下使用ASP.NET连接ACCESS数据库时提示如下错误的解决方法
IIS7下使用ASP.NET连接ACCESS数据库时提示如下错误的解决方法
发布时间:2016-12-22 来源:查字典编辑
摘要:“/”应用程序中的服务器错误。未在本地计算机上注册“microsoft.jet.oledb.4.0&rd...

IIS7下使用ASP.NET连接ACCESS数据库时提示如下错误的解决方法1

“/”应用程序中的服务器错误。

未在本地计算机上注册“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) + "";

注意:只需要修改为红色字体部份,其它的不用修改。也就是换一种连接数据库的驱动。

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新故障排除学习
热门故障排除学习
电脑子分类