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