In this article I will explain with an example, how to resolve the following error:
The 'Microsoft.ACE.OLEDB.16.0' provider is not registered on the local machine while using
OLEDB.
Error
The following error occurs when you make use of Excel 2007 or higher or Access 2007 or higher files using
OLEDB connection.
This happens only for Office 2007 or higher as it requires use of OLEDB ACE drivers for connection which do not come by default in Windows.
Solution
The solution to this Error is to make sure Microsoft.ACE.OLEDB.12.0 provider are installed.
Downloading Microsoft.ACE.OLEDB.16.0 provider
For downloading the Microsoft Access Database Engine 2016 Redistributable file you will need to click on following link.
After that click on Download button.
Then, select the architecture i.e. 32 BIT (x86) or 64 BIT (x64) and click on Download button.
After that, the AccessDatabaseEngine file will be downloaded successfully.
Installing Access Database Engine
For Installing Access Database Engine, you will need to follow the below steps:
1. After downloading,you will get the following accessdatabaseengine_X64.exe file as shown below.
2. Right click on it and click on Open.
3. Simply click on Next.
4. Then, you need to acccept the End-User License Agreement by checking the CheckBox and then click on Next.
5. You can browse the location where you want to save the Access Database Engine and click on Install.
6. Once the installation is completed, click on Finish Button.
If problem persists
If still you are getting an error then, you will need to check the architecture of the Visual Studio application.
In order to check the architecture of the Visual Studio application, you will need to open Visual Studio and then look for Help from the menu bar and click on it.
Then, select About Microsoft Visual Studio.
After opening the About Microsoft Visual Studio, you can check the architecture.
If it shows *32 it means that the Visual Studio is a 32 BIT application.
Thus, in such case, you will need to uninstall the 64 BIT (x64) version of the driver and then download and install 32 BIT version of Microsoft Access Database Engine 2010 Redistributable file.