For anyone developing in Visual Studio the answer is to uncheck Prefer 32-bit in the project properties compile page.
How to fix The microsoft.ACE.OLEDB.12.0 provider is not registered on the local machine (Azure) for Access Database
Connection to ACCESS database fails with exception:
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine
Azure App Service
4 answers
Sort by: Most helpful
-
-
Ed Choi 55 Reputation points
2023-07-02T15:38:43.9933333+00:00 Problem
ACCESS database connection failure on an app in Azure Web Service:
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine
The 'Microsoft.Jet.Ole8db.4.0' provider is not registered on the local machine.
Background
Microsoft recognizes that the error is by design as we do not install the Microsoft.Ace.we.12.0' driver. The Microsoft.Ace drivers are not supported in server side environments and as of now there is no plans to add these to the Azure Web Sites.
My working solution
The solution is complex, but it is working at least.
Step 1) Separate connection strings for the 64-bit source (on PC) and 32-bit target (Azure)
Connection String for 64-bit environment:
"Provider=Microsoft.ACE.OLEDB.12.0;" & "Data Source=" & sMdb & ";" & "Jet OLEDB:Database Password=" & sPass & ";" & "Persist Security Info=True;"
Connection String for 32-bit target environment:
"Provider=Microsoft.Jet.Ole8db.4.0;" & "Data Source=" & sMdb & ";" & "Jet OLEDB:Database Password=" & sPass & ";" & "Persist Security Info=True;"
Step 2) Adjust Registry Editor
In the search box on the taskbar, type “regedit” to open Registry Editor and adjust
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion
Add:
DWORD ForceLog set value to 1
DWORD LogFailures set value to 1
DWORD LogResourceBinds set value to 1
DWORD EnableLog set value to 1
String LogPath set value to folder for logs (e.g. C:\FusionLog)
(reference: https://stackoverflow.com/questions/255669/how-to-enable-assembly-bind-failure-logging-fusion-in-net)
Step 3) Switch settings when deploying to Azure
- Compiler settings
Change Project / Property / Compile / Target CPU to “x86”
- Menu bar - Build / Configuration Manager
Change Platform to "x86"
- IIS – Application Pools
Change Enable 320Bit Applications to “True”
Step 4) Switch settings back to 64-bit development PC environment
- Compiler settings
Change Project / Property / Compile / Target CPU to “Any CPU”
- Menu bar - Build / Configuration Manager
Change Platform to "Any CPU"
- IIS – Application Pools
Change Enable 320Bit Applications to “False”
-
SnehaAgrawal-MSFT 22,706 Reputation points Moderator
2023-06-30T06:04:46.86+00:00 Apologies for facing issue on this! If you are receiving the following error on your Azure Web Site
'Microsoft.Ace.OLEDB.12.0' provider is not registered on the local machine
The error is by design as we do not install the Microsoft.Ace.we.12.0' driver.
The Microsoft.Ace drivers are not supported in server side environments and as of now there is no plans to add these to the Azure Web Sites.Workaround-
This leaves the option of using the Jet Drivers which are installed, however these are only available in 32 bit versions so you will have to configure your site to run in 32 bit versions. The Microsoft OLE DB Provider for Jet and the Microsoft Access ODBC driver are available in 32-bit versions only: http://support.microsoft.com/kb/957570/en-us
This is also discussed here: Data Access Technologies Road Map http://msdn.microsoft.com/en-us/library/ms810810.aspx#bkmk_DepMDAC_WDACComps
Also, you could use Windows Containers to install these drivers.
Quickstart: Run a custom container on App Service - Azure App Service | Microsoft LearnFurther if you wish you may share your feedback on Azure Web App Uservoice -
All of the feedback, you share in these forums will be monitored and reviewed by the Microsoft engineering teams responsible for building Azure. Additionally, users with a similar request can up-vote you post and add their comments.
Please let us know, if you have further query or issue remains.
-
TT 70 Reputation points
2024-09-09T22:11:26.6766667+00:00 The Wayback Machine and Internet Archive FOR THE WIN!
This was sourced from chocolatey, but is available for direct download from the following links:
Chocolately package for reference: https://community.chocolatey.org/packages/made2010#files
Cheers!