C#匯入excel時報錯:The ‘Microsoft.Ace.OleDb.12.0′ provider is not registered on the local mach

來源:互聯網
上載者:User

 

Asp.net 發布到IIS 上,做匯入excel功能時報標題所寫的錯誤。在網上找了許多方法,都未能解決問題,現問題得已解決,在此小結下,如有遇到同樣問題,方便參考~

 

解決方案1:下載AccessDatabaseEngine(http://www.microsoft.com/zh-cn/download/details.aspx?id=23734)

支援的作業系統

Windows Server 2003 Service Pack 1, Windows Vista, Windows XP Service Pack 2

 

解決方案2:下載AccessDatabaseEngine(http://www.microsoft.com/zh-cn/download/details.aspx?id=13255)(這個相容上面所說的,在此都列舉出來哈~)

支援的作業系統

Windows 7, Windows Server 2003, Windows Server 2003 Service Pack 1, Windows Server 2003 Service Pack 2, Windows Server 2008 R2, Windows Server 2008 Service Pack 2, Windows Vista Service Pack 1, Windows XP Service Pack 2                        

在 Windows XP Service Pack 3 上只能使用 32 位 Access 資料庫引擎

 

使用此下載:(參考微軟Download Center)
1.如果您是應用程式使用者,請查閱應用程式文檔以獲得有關如何使用相應驅動程式的詳細資料。
2.如果您是使用 OLEDB 的應用程式開發人員,請將 ConnectionString 屬性的 Provider 參數設定為“Microsoft.ACE.OLEDB.12.0”
◦如果要串連到 Microsoft Office Excel 資料,請將“Excel 14.0”添加到 OLEDB 連接字串的擴充屬性中。
3.如果您是使用 ODBC 串連到 Microsoft Office Access 資料的應用程式開發人員,請將連接字串設定為“Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=path to mdb/accdb file”
4.如果您是使用 ODBC 串連到 Microsoft Office Excel 資料的應用程式開發人員,請將連接字串設定為“Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=path to xls/xlsx/xlsm/xlsb file

 

 FYI

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.