I'm trying to get data from an Excel file on a button click event. My connection string is:
string connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\source\\SiteCore65\\Individual-Data.xls;Extended Properties=Excel 8.0;";
When I click on the button, I got the following error:
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
I have no clue how to fix this. My operating system is Windows 7.
I installed the MS drivers and it still didn't work for me. Then I found this blog post that solved the issue. Read it there, else use these two images (linked from that post) as the TLDR sumamary:
Remember to install AccessDatabaseEngine on server for web application.
For all those still affected by this.
I've been getting the error...
...as described by the OP, Shailesh Sahu.
I have 64bit Windows 7.
My problem is within PowerShell scripts, but is using a connection string, similar to the OP's post, so hopefully my findings can be applied to C#, PowerShell and any other language relying on the "Microsoft.ACE.OLEDB" driver.
I followed instructions on this MS forum thread: http://goo.gl/h73RmI
I first tried installing the 64bit version, then installing the 32bit version of the AccessDatabaseEngine.exe from this page http://www.microsoft.com/en-us/download/details.aspx?id=13255
But still no joy.
I then ran the code below in PowerShell (from SQL Panda's site http://goo.gl/A3Hu96)
...which gave me this result (I've removed other data sources for brevity)...
As you can see, I have Microsoft.ACE.OLEDB.15.0 (fifteen) not Microsoft.ACE.OLEDB.12.0 (twelve)
So, I amended my connection string to 15 and it worked.
So, a quick PowerShell snippet to demonstrate how to soft-code the version...
amended to pick the latest ACE version, if more than one
Hopefully, anyone finding this can now check to see what OLEDB version is installed and use the appropriate version number.
syp_dino,
The solution for me as you suggested for the "Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine" error is to change the Active Solution Platform from "Any CPU" to "x86".
When I performed those steps, rebuilt the solution, grabbed the EXE and placed in on the network, everything worked smoothly on the Windows 7 64 bit machine.
I got this error/exception in Visual Studio 2010 when I changed my build in the Configuration Manager dialog box from "x86" to "Any CPU". This OLEDB database driver I understand only works in x86 and is not 64bit compatible. Changing the build configuration back to x86 solved the problem for me.
I had the same issue but in this case microsoft-ace-oledb-12-0-provider was already installed on my machine and working fine for other application developed.
The difference between those application and the one with I had the problem was the Old Applications were running on "Local IIS" whereas the one with error was on "IIS Express(running from Visual Studio"). So what I did was-