Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

the 'microsoft.ace.oledb.12.0' provider is not registered on the local machine while reading a excel file in c# [duplicate]

I am reading an excel file and I want to access its contents. I am using this connection string:

connectionString = string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0}; Extended Properties=Excel 12.0;", Server.MapPath(fileName));

But I see this error:

The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.

My server is running on 64-bit operating system. I have installed Microsoft Office Professional Plus 2010(32-bit) and Microsoft Access database engine 2010 on it.

What is the problem?

like image 910
Hamid Reza Avatar asked Oct 28 '15 07:10

Hamid Reza


2 Answers

Check out the following links, if they solve the issue that you are encountering:

http://www.mikesdotnetting.com/article/280/solved-the-microsoft-ace-oledb-12-0-provider-is-not-registered-on-the-local-mac

http://www.codeproject.com/Tips/417397/OLEDB-Provider-is-Not-Registered-on-the-Local-Mach

https://social.msdn.microsoft.com/Forums/en-US/f11b2df9-fd0a-4528-987f-f95dfdccee0a/microsoftaceoledb120-provider-is-not-registered-on-the-local-machine-error?forum=adodotnetdataproviders

Last one suggests downloading a patch from - http://www.microsoft.com/en-us/download/details.aspx?id=13255

like image 90
Mrinal Kamboj Avatar answered Nov 17 '22 13:11

Mrinal Kamboj


The reason is that the ACE.OLEDB.12.0 dosen't work in the 64-bit Operating system.

You can refer this forum as well. You have to download the patch from here.

like image 2
Rahul Tripathi Avatar answered Nov 17 '22 11:11

Rahul Tripathi