Fixing the 'Microsoft.ACE.OLEDB.12.0 provider is not registered' Error

intermediate📊 Microsoft Excel2026-04-18| Windows 10/11, .NET 6/8, .NET Framework 4.8, SQL Server 2019/2022, IIS 10, Office 365.

Error Message

The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
#excel#oledb#database-connection#dotnet#iis

Understanding the Error

You will typically encounter this error when a .NET application, a web service on IIS, or the SQL Server Import and Export Wizard attempts to read an Excel (.xlsx) or Access (.accdb) file. The system searches for the OLEDB driver to bridge the communication. If that bridge is missing or the wrong size, the connection fails immediately.

The Two Primary Culprits

Most connection failures stem from two specific issues. First, the Microsoft Access Database Engine might be missing entirely. Second, and far more common, is a bitness mismatch. If your application runs as a 64-bit process but you only have the 32-bit driver installed, the application cannot "see" the provider, even though it exists on your hard drive.

Step 1: Install the Correct Database Engine

Do not assume that having Microsoft Office installed means you have the necessary OLEDB providers. Office installations often lack the redistributable components required by external software. To fix this, download the Microsoft Access Database Engine 2016 Redistributable.

  • Identify your app's architecture: You must match the driver to your application, not your Windows version.
  • If your app is 32-bit, download accessdatabaseengine.exe (approx. 75 MB).
  • If your app is 64-bit, download accessdatabaseengine_X64.exe (approx. 79 MB).

Step 2: Resolve Bitness Mismatches

This is the most frequent stumbling block for developers. Suppose you have 32-bit Office on a 64-bit Windows machine. If you build a .NET app targeting "Any CPU," the runtime defaults to 64-bit. It will then look in the 64-bit registry for a driver that only exists in the 32-bit hive.

Configuration for Visual Studio:

Force your project to target the specific architecture of your installed driver:

  • Right-click your project in Solution Explorer and select Properties.
  • Navigate to the Build tab.
  • Locate the Platform target dropdown.
  • Switch from Any CPU to x86 (for 32-bit drivers) or x64 (for 64-bit drivers).
  • Rebuild your solution and test the connection.

Configuration for IIS Web Applications:

Web applications often fail because IIS Application Pools run in 64-bit mode by default. If you are using the 32-bit driver, you must adjust the pool settings:

  • Open IIS Manager and click on Application Pools.
  • Find the pool running your application and select Advanced Settings.
  • Locate Enable 32-Bit Applications and set it to True.

Step 3: SQL Server and SSMS Nuances

When using the SQL Server Import and Export Wizard, remember that SQL Server Management Studio (SSMS) is a 32-bit application. Even on a powerful 64-bit server, the standard wizard may fail to find the 64-bit ACE provider. Always look for the SQL Server Import and Export Wizard (64-bit) in your Start Menu if you are working with 64-bit drivers.

How to Verify Registered Providers

Stop guessing whether the driver is correctly registered. You can query the OS directly using PowerShell to see exactly what is available to your environment. Run the following command:

(New-Object system.data.oledb.oledbenumerator).GetElements() | select SOURCES_NAME, SOURCES_DESCRIPTION | Where-Object { $_.SOURCES_NAME -like "*ACE.OLEDB*" }

If the results are empty, the driver is either missing or you are running the 64-bit version of PowerShell while only the 32-bit driver is installed.

Standard Connection String

A properly formatted connection string is vital. For modern Excel files (.xlsx), use the following structure:

string connString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Data\Sales.xlsx;Extended Properties='Excel 12.0 Xml;HDR=YES;'";

Pro Tips for Production Environments

  • Server Hygiene: Never install the full Office suite on a production server. It increases the attack surface and introduces unnecessary overhead. Use only the Redistributable Engine.
  • The Forced Install: If the 64-bit installer blocks you because 32-bit Office is present, run the installer via the command line with the /quiet flag to bypass the check.
  • Version Upgrades: While ACE.OLEDB.12.0 is the standard, upgrading to Microsoft.ACE.OLEDB.16.0 (from the 2016 redistributable) often solves stability issues with massive Excel workbooks exceeding 50MB.

Related Error Notes