I am running a C# Windows Application that reads an Excel File. I am getting the now famous "The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine." error when I try reading an Excel file.
Configuration Information
OS => Windows Server 2008 R2 Service Pack 1 ( 64 Bit )
Microsoft Office 2007 ( 32 Bit )
C# Windows Application
Build Configuration ( Compilation )
I compiled my application for "x86" ( 32 bit ).
Office Components
I downloaded the 2007 Office System Driver: Data Connectivity Components from the following link and installed it.
From Control Panel -> Programs I ensured that this is the only Microsoft Access Database Engine that is installed.
I was able to verify that the Provider DLL ACEOLEDB.DLL was found in the correct place mentioned below :
C:\Program Files (x86)\Common Files\microsoft shared\OFFICE12\ACEOLEDB.DLL ( Size is 379 KB )
I was able to verify from SQL Server that MICROSOFT.ACE.OLEDB.12.0 is registered ( We can query for the complete list of OLE DB Providers )
Registry
This is also listed in the REGISTRY.
HKEY_CLASSES_ROOT\Microsoft.ACE.OLEDB.12.0 CLSID => {3BE786A0-0366-4F5C-9434-25CF162E475E}
I also tried explicitly registering the DLL using regsvr32 but it failed as it is COM component and unable to invoke
the dllRegisterServer method.
Excel Connection String
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\users\admin\test.xls;Extended Properties="Excel 8.0;HDR=YES";
Your help with this issue will be highly appreciated. Should you need any specific configuration information I will glad to share.