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

1个回答

写回答

Terrycheese

2024-08-27 04:14

+ 关注

服务器
服务器

这是由于我们使用的Win2008系统是64位的,以前Win2003是32位的系统。

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

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

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

举报有用(17分享收藏

Copyright © 2025 IZhiDa.com All Rights Reserved.

知答 版权所有 粤ICP备2023042255号