I\' m using a Windows Forms application to export data to excel.
Application is built both x64 and x86.
So both version of Microsoft Access Databse Engine mu
I had similar problems and I reinstalled the Microsoft Access Database Engine, using the repair option. It worked for me.
I can propose a horrible solution but when you are under pressure, it works. Open the Excel file and save it as an xls file instead of xlsx. Install the ACEOLEDB.12 32 bit version and pull your data in that way. This is not the answer, but it may suffice as a work-around.
For most occasions, the "Flat File" import in SQL Server option will work just fine.
In my case I had Office 2013 x64 installed. I then installed AccessDatabaseEngine2016_X64.exe
after which I installed AccessDatabaseEngine2016.exe
using the "/quiet" switch. I found that if I installed the x86 engine first I would get the error you're seeing, so order matters. I also changed my connection strings to Provider=Microsoft.ACE.OLEDB.16.0
(which appears to provide better OleDb error reporting).
You can verify driver installation using ODBC Data Sources.
I had the same error. It was fixed when I changed Provider=Microsoft.ACE.OLEDB.12.0;
to Provider=Microsoft.ACE.OLEDB.16.0;
I was running Office 2016.
This will usually occur when the build configuration platform in Visual Studio is incorrect, this can occur in both build configuration platforms, x86 and x64.
This is due to a mismatch between the build configuration platform of your project and the Microsoft Access Database Engine which is installed on your machine.
In order to resolve this error:
I have both 64 and 32 bit versions, and I had the same problem. I just went to the properties of the project and in the tab Build, I uncheck the box that says Prefer 32-bit.