Microsoft Access OLEDB Provider

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.
July 13th, 2015 2:21am

Connection String:

https://www.connectionstrings.com/excel-2007/

Refer to:

http://forums.asp.net/

for writing an ASP.net program that extracts an Excel file.

Here is an C# ASP.net example.  "Add References" set to "Microsoft Excel 13 Object Library".

            Microsoft.Office.Interop.Excel.Application exlApp = new Microsoft.Office.Interop.Excel.Application();
            Microsoft.Office.Interop.Excel.Workbook exlWb = exlApp.Workbooks.Open(@"C:\Users\User\Documents\Test.xls");
            Microsoft.Office.Interop.Excel.Worksheet exlWs = exlWb.Sheets["Sheet1"];
            Microsoft.Office.Interop.Excel.Range usedRange = exlWs.UsedRange;
            int col = Convert.ToInt32(usedRange.Columns.Count);
            int row = Convert.ToInt32(usedRange.Rows.Count);
            exlApp.Visible = false;
            string[,] cellValue = new string[row + 1, col + 1];
            for (int j = 1; j <= row - 1; j++)
            {
                for (int k = 1; k <= col - 1; k++)
                {
                    cellValue[j, k] = exlWs.Cells[j, k + 1].ToString();
                }
            }




Free Windows Admin Tool Kit Click here and download it now
July 13th, 2015 4:22pm

Thanks for the response and the sample code. I have already done it the way you have mentioned and it works fine. But I wanted to know why I am getting that error though I seem to be on the correct path.

July 15th, 2015 12:29pm

Hi Bvenkata,

I'm glad that we are helpful, for the detailed troublshooting you can refer to the sap.net forums.

Best Regards,

Elaine

Free Windows Admin Tool Kit Click here and download it now
July 19th, 2015 11:07pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics