Working with Excel files can always be of great interest. I have not seen a reporting solution in the world that doesn’t give an option to export to excel. If you are talking about two separate solutions and you want to export and import, then such options can be of great use. In this blog, I was trying to import data from Excel sheet to SQL Instance by using Import Wizard available in SQL Server Management Studio. I am sure all of us have had this requirement once in a while and would have surely tried to get this working.
After selecting the option, I selected Data Source as “Microsoft Excel” and selected file name which I wanted to import. Excel file was created with latest version of excel so I selected “Microsoft Excel 2007”.
As soon as I hit next, I got below error
TITLE: SQL Server Import and Export Wizard
The operation could not be completed.
The ‘Microsoft.ACE.OLEDB.12.0′ provider is not registered on the local machine. (System.Data)
I checked management studio and as the message says, I didn’t see the provider as we can see below. We can also use below query to find the details of providers installed on the machine
Few blogs have mentioned to download https://www.microsoft.com/en-us/download/details.aspx?id=23734 (2007 Office System Driver: Data Connectivity Components) but that didn’t work. So I tried installing http://www.microsoft.com/en-us/download/details.aspx?id=13255 (Microsoft Access Database Engine 2010 Redistributable) but it also failed because I am using 32 bit version of office on my 64 bit PC.
Note: If you are running 32-bit version of SQL then your issue will be solved by installing above. In my PC, I have to take below approach.
- Uninstall 32-bit version of Microsoft Office.
- Install the 64-bit version of MS Office (Make sure setup is run from “x64″ folder and run setup.exe in order to install the 64 bit of MS Office).
- Install the 64-bit version “Microsoft.ACE.OLEDB.12.0″ (download AccessDatabaseEngine_x64.exe from second link provided earlier).
Here is the location of DLL “ACEOLEDB.DLL”
- On a 32-bit operating system
- C:\Program Files\Common Files\Microsoft Shared\OFFICE14\ACEOLEDB.DLL
- On a 64-bit operating system
- If 32-bit office is installed then
C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE14\ACEOLEDB.DLL
- If 64-bit office is installed then
C:\Program Files\Common Files\Microsoft Shared\OFFICE14\ACEOLEDB.DLL
Production Server would not have complete office installed so it would not be a big deal to install correct version of driver.
Have you ever encountered this error in your environments? What did you do to solve them? Let me know.
Reference : Pinal Dave (http://blog.SQLAuthority.com)