.NET讀取EXCEL檔遇到的問題

Exception :
the microsoft.jet.oledb.4.0 provider is not registered on the local machine

如果是winform一般程式:
參考: http://www.dotblogs.com.tw/dc690216/archive/2009/09/17/10674.aspx
以下為解決的方法:
1.在專案名稱按右鍵,選擇 Properties
2.開啟後,選擇到 Build
3.將 Platform target 改為 x86

如果是web程式:
參考: http://www.telerik.com/support/kb/aspnet-ajax/general/error-on-64-bit-windows-machines-the-microsoft-jet-oledb-4-0-provider-is-not-registered-on-the-local-machine.aspx
PROBLEM
Installing RadControls on a 64-bit machine and running the examples that use Access as its database may cause the following error:
The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine.
even if you have the Microsoft.Jet.OLEDB.4.0 provider installed.

DESCRIPTION
The problem stems from the fact that the MS Jet engine (the DB engine behind Microsoft Access) does not have a 64-bit port. Running on a 64-bit machine will default to a 64-bit web application pool and it will not be able to find the 32-bit version of the Jet engine component.

The solution is to configure the application pool and enable 32-bit application support. For IIS 7, running on Windows Vista, you can do this from the application pool's advanced settings dialog:

posted @ 2013-03-05 06:23  日光之下无新事  阅读(167)  评论(0)    收藏  举报