office交流網(wǎng)--QQ交流群號及微信交流群

Access培訓(xùn)群:792054000         Excel免費(fèi)交流群群:686050929          Outlook交流群:221378704    

Word交流群:218156588             PPT交流群:324131555

微信交流群(請用微信掃碼)

        

最近經(jīng)常出現(xiàn)的與Excel導(dǎo)入莫名出錯(cuò)的解決辦法

2017-10-30 08:26:00
zstmtony
原創(chuàng)
15991

最近更新過微軟windows一些最新補(bǔ)丁的電腦(2017年10月10日開始),凡是使用Excel Driver(驅(qū)動(dòng))導(dǎo)入或讀取Excel文件的VBA代碼都會(huì)出現(xiàn)以下錯(cuò)誤:

基本上都是跟OLEDB有關(guān),導(dǎo)致很多導(dǎo)入Excel的功能(如一些ERP軟件,或Excel Access的 VBA相關(guān)功能)都會(huì)出錯(cuò):

影響非常多的電腦和軟件,在這個(gè)月中,我們是接近10多個(gè)客戶都出現(xiàn)類似的問題:


[ODBC Excel Driver] Reserved error (-5016); there is no message for this error. ERROR [01000] [Microsoft][ODBC Excel Driver]General Warning Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x1644 Thread 0x3e70 DBC 0x4c51fc4 Excel'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed ERROR [01000] [Microsoft][ODBC Excel Driver]General Warning Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x1644 Thread 0x3e70 DBC 0x4c51fc4 Excel'. ERROR [HY000] [Microsoft][ODBC Excel Driver] Reserved error (-5016); there is no message for this error.

Unexpected error from external database driver (1).

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Unexpected error from external database driver (1).

Source Error:


Line 415:        strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filepath + ";Extended Properties='Excel 8.0;HDR=NO;IMEX=1;'";
Line 416:        OleDbConnection conn = new OleDbConnection(strConn);
Line 417:        conn.Open();
Line 418:        DataTable sheetNames = conn.GetOleDbSchemaTable
Line 419:        (System.Data.OleDb.OleDbSchemaGuid.Tables, new object[] { null, null, null, "TABLE" });



經(jīng)過查找各種資料,發(fā)現(xiàn)是


windows  最近更新了一個(gè)補(bǔ)丁KB4041681 導(dǎo)致odbc相關(guān)操作全部失效 卸載這個(gè)補(bǔ)丁就恢復(fù)正常了


發(fā)現(xiàn)問題原因是由于微軟補(bǔ)丁更新了jet4.0的組件導(dǎo)致,具體補(bǔ)丁列表如下:

Win7 SP1更新微軟KB4041678、KB4041681(10月匯總包)補(bǔ)??;
WindowsServer 2008 R2更新微軟KB4041678、KB4041681(10月匯總包)補(bǔ)?。?/span>
Win10更新微軟KB4041676、KB4041691(10月匯總包)補(bǔ)?。?/span>
WindowsServer 2016更新微軟KB4041691(10月匯總包)補(bǔ)?。?/span>
Win8.1更新微軟KB4041693補(bǔ)??;
WindowsServer 2012 R2更新微軟KB4041693補(bǔ)丁。



微軟暫時(shí)也沒有更好的辦法,現(xiàn)在的處理方法,最好是卸載


微軟官方的說明


此更新中的已知問題



癥狀 解決方法
安裝 KB4041681 后,更新包用戶在關(guān)閉某些應(yīng)用時(shí)可能會(huì)看到表明產(chǎn)生應(yīng)用異常的錯(cuò)誤對話。 這個(gè)問題會(huì)影響到使用 mshtml.dll 加載網(wǎng)站內(nèi)容的應(yīng)用。 該問題僅在進(jìn)程已經(jīng)關(guān)閉的情況下才會(huì)發(fā)生,不會(huì)影響到應(yīng)用的功能。 Microsoft 正尋求一種解決方案,并會(huì)在即將發(fā)布的版本中提供更新。

安裝此更新后,可能會(huì)導(dǎo)致基于 Microsoft JET 數(shù)據(jù)庫引擎(Microsoft Access 2007 和更低版本或非 Microsoft 應(yīng)用程序)的應(yīng)用程序無法創(chuàng)建或打開 Microsoft Excel .xls 文件。 錯(cuò)誤消息為“外部數(shù)據(jù)庫驅(qū)動(dòng)程序 (1) 中的意外錯(cuò)誤。 (Microsoft JET 數(shù)據(jù)庫引擎)?!?/span>

下載并安裝 Microsoft Access 數(shù)據(jù)庫引擎 2010 可再發(fā)行軟件包,然后在 Microsoft Excel 中修改 DB 連接字符串以將 ACE 用作提供程序。 示例: 將 Provider=Microsoft.Jet.OLEDB.4.0 更改為 Provider=Microsoft.ACE.OLEDB.12.0。

Microsoft 正尋求一種解決方案,并會(huì)在即將發(fā)布的版本中提供更新。






其它相關(guān)資料:



微軟最近更新KB4041681 KB4041678這兩個(gè)補(bǔ)丁 導(dǎo)致excel導(dǎo)入出問題。卸載之后就好了。如果在程序上修改 如何修改我是用的 這種導(dǎo)入方式OleDbCommand cmdImport =
微軟最近更新KB4041681 KB4041678這兩個(gè)補(bǔ)丁 導(dǎo)致excel導(dǎo)入出問題。 
卸載之后就好了。 
如果在程序上修改 如何修改 

我是用的 這種導(dǎo)入方式 

OleDbCommand cmdImport = new OleDbCommand(sSql, new OleDbConnection(ConnStr));

OleDbDataAdapter adpImport = new OleDbDataAdapter(cmdImport);

DataSet dsImport = new DataSet();
    分享
    文章分類
    聯(lián)系我們
    聯(lián)系人: 王先生
    Email: 18449932@qq.com
    QQ: 18449932
    微博: officecn01
    移動(dòng)訪問