Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ODBC Excel Driver: Unexpected error from external database driver

Since the Windows update from October 10, the ODBC Excel drivers have stopped working. We get the following error when trying to read a file:

"Unexpected error from external database driver (1)"

We open Excel files in Delphi using an ADO connection with the following connection string:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";

I can get it to work by switching to Microsoft.ACE.OLEDB.12.0, but for that to work, all our customers would have to install the Microsoft Access Database Engine Redistributable on all the computers they use our software on.

Does anybody have another solution or workaround? Thanks in advance.

like image 284
Bram Avatar asked Oct 17 '22 04:10

Bram


2 Answers

On a customers machine I have deinstalled KB4041681 (Windows 7) which came with last Microsoft Patch. On my machine I have deinstalled KB4041676 (Windows 10). After that Microsoft.Jet.OLEDB.4.0 is now working.

I hope that Microsoft will fix this bug soon.

like image 128
donhauro Avatar answered Oct 20 '22 20:10

donhauro


There is one solution. Replace "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1" with Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\MyExcel.xls; Extended Properties=\"Excel 12.0;HDR = YES; After this change you will have to install 2007 Office System Driver: Data Connectivity Components from link on customer machine.

like image 25
Sashus Avatar answered Oct 20 '22 20:10

Sashus