Win7 ASP連接數(shù)據(jù)庫“未找到提供程序.該程序可能未正確安裝”問題
更新時間:2012年01月08日 18:42:18 作者:
今天調(diào)試了基于Access數(shù)據(jù)庫的ASP應用,沒想到IIS7報錯,提示ADODB.Connection 錯誤 '800a0e7a' 未找到提供程序。該程序可能未正確安裝
ASP連接數(shù)據(jù)庫的連接字符串是Provider=Microsoft.Jet.OLEDB.4.0; Data Source=路徑,采用的是OleDB方式連接,問題可能就出在OleDB方式連接這一環(huán)節(jié)上。
后來搜索網(wǎng)絡得到了解決的辦法 。原來是自己裝的64位Windows 7系統(tǒng)的原因,默認64位環(huán)境下,IIS應用程序池未啟用32位應用程序,我們只需要啟用一下就可以了。打開IIS 7,定位到“應用程序池”,然后選擇使用OleDB方式連接數(shù)據(jù)庫的程序池,然后將啟用32位應用程序設置為True就可以了。

Using MyODBC with ASP.NET in IIS7 on Vista x64
That's a heck of a title, but it's a problem I hit recently. I have a bunch of ASP.NET sites that use MySQL as their datastore, but I hadn't tried the on IIS7 yet. It took a while to get them to work at all (I had to set permissions on web.config and the other website files so that they could be read by both the Users group and the IIS_IUSRS group), but then I was left with an error about my MySQL connection. “ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified” – another very general error that basically means “Something is wrong with your ODBC driver, somewhere.”
After some searching, I learned two things. The first is that if you're running 64-bit you can't use the standard ODBC Data Source Administrator in Administrative Tools with MySQL. You've got to go to C:\Windows\SysWOW64\odbcad32.exe and set up your DSN, if that's your thing. The other thing is that the MyODBC driver is 32-bit only. So to use it at all, you need to make sure you're calling it from 32-bit apps only. That means you've got to tweak the Application Pool you're using to run all its ASP.NET applications as 32-bit. To do this, go to Administrative Tools > Internet Information Services (IIS) Manager (or just hit the Windows key and type “IIS”). Then go to “Application Pools” and select whichever application pool your ASP.NET app uses (or create a new one just for your MySQL apps. Click “Advanced Settings…” and set “Enable 32-Bit Applications”. Now the AppPool will use the 32-bit .NET CLR to run your app, and it'll be able to see your MyODBC driver (whether you use a DSN or not).
后來搜索網(wǎng)絡得到了解決的辦法 。原來是自己裝的64位Windows 7系統(tǒng)的原因,默認64位環(huán)境下,IIS應用程序池未啟用32位應用程序,我們只需要啟用一下就可以了。打開IIS 7,定位到“應用程序池”,然后選擇使用OleDB方式連接數(shù)據(jù)庫的程序池,然后將啟用32位應用程序設置為True就可以了。

Using MyODBC with ASP.NET in IIS7 on Vista x64
That's a heck of a title, but it's a problem I hit recently. I have a bunch of ASP.NET sites that use MySQL as their datastore, but I hadn't tried the on IIS7 yet. It took a while to get them to work at all (I had to set permissions on web.config and the other website files so that they could be read by both the Users group and the IIS_IUSRS group), but then I was left with an error about my MySQL connection. “ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified” – another very general error that basically means “Something is wrong with your ODBC driver, somewhere.”
After some searching, I learned two things. The first is that if you're running 64-bit you can't use the standard ODBC Data Source Administrator in Administrative Tools with MySQL. You've got to go to C:\Windows\SysWOW64\odbcad32.exe and set up your DSN, if that's your thing. The other thing is that the MyODBC driver is 32-bit only. So to use it at all, you need to make sure you're calling it from 32-bit apps only. That means you've got to tweak the Application Pool you're using to run all its ASP.NET applications as 32-bit. To do this, go to Administrative Tools > Internet Information Services (IIS) Manager (or just hit the Windows key and type “IIS”). Then go to “Application Pools” and select whichever application pool your ASP.NET app uses (or create a new one just for your MySQL apps. Click “Advanced Settings…” and set “Enable 32-Bit Applications”. Now the AppPool will use the 32-bit .NET CLR to run your app, and it'll be able to see your MyODBC driver (whether you use a DSN or not).

您可能感興趣的文章:
- 完美解決ASP 不能更新。數(shù)據(jù)庫或?qū)ο鬄橹蛔x。
- ASP連接SQL2005數(shù)據(jù)庫連接代碼
- asp中用insert into語句向數(shù)據(jù)庫插入記錄(添加信息)的方法
- ASP連接Access數(shù)據(jù)庫的幾種方法
- ASP.NET web.config中數(shù)據(jù)庫連接字符串connectionStrings節(jié)的配置方法
- C#和asp.net中鏈接數(shù)據(jù)庫中參數(shù)的幾種傳遞方法實例代碼
- ASP.NET連接MySql數(shù)據(jù)庫的2個方法及示例
- ASP獲取數(shù)據(jù)庫表名、庫名、字段名的方法
- asp.net中EXCEL數(shù)據(jù)導入到數(shù)據(jù)庫的方法
- 淺談ASP數(shù)據(jù)庫下載漏洞
相關(guān)文章
WebsitePanel Standalone Server安裝配置方法
這篇文章主要為大家介紹下WebsitePanel安裝后的配置方法,結(jié)合了上一篇文章,需要的朋友可以參考下2013-12-12
NET Runtime Optimization Service 1101 錯誤的解決方法
這篇文章主要介紹了NET Runtime Optimization Service 1101 錯誤的解決方法,需要的朋友可以參考下2015-09-09
安裝服務器常見組件之ISAPI_Rewrite組件圖文安裝教程
本教程共分八篇:系統(tǒng)安裝與設置篇、軟件安裝與設置篇、文件及文件夾權(quán)限篇、系統(tǒng)服務篇、安全策略篇、系統(tǒng)組件篇、注冊表篇、軟件安全篇。本篇討論的是第二篇軟件安裝與設置篇的第五部分:安裝常見組件之ISAPI_Rewrite組件安裝圖解。2010-05-05
Win2008 R2 64Bit下IIS環(huán)境安裝memcache和memcached服務端的方法
這篇文章主要介紹了Win2008 R2 64Bit下IIS環(huán)境安裝memcache和memcached服務端的方法,需要的朋友可以參考下2016-06-06

