Errors with MS Access Provider

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
dvandenbossche
User
Posts: 18

Errors with MS Access Provider

Post by dvandenbossche »

New Windows 10 x64 machine
Access 2010 and 2016 installed
MDAC and Jet 4 installed
ASP.NET Maker 2016.0.2

The website is not displayed. See the following errors.
What can I do more than installing all the components mentioned on you website?
If I use a mdb database the same errors are generated but in stead of OLEDB.12 it is about the JET40 engine.

Project VZPApp (.NETFramework,Version=v4.6.2) was previously compiled. Skipping compilation.
info: Microsoft.Extensions.DependencyInjection.DataProtectionServices[0]
User profile is available. Using 'Users\dirkv\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
Hosting environment: Production
Content root path: Webstite VZP Leden\VZPApp
Now listening on: localhost:5000
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET //localhost:5000/
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1]
Executing action method AspNetMaker2016.Controllers.HomeController.Index (VZPApp) with arguments () - ModelState is Valid
info: Microsoft.AspNetCore.Session.DistributedSession[3]
Session started; Key:2cf7590e-4d44-8e09-981a-48bbeecbd6eb, Id:7279d0c8-ffbd-fe55-130b-a3c2bf0b0f6f
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]
An unhandled exception has occurred: Het doel van een aanroep heeft een uitzondering veroorzaakt.
System.Reflection.TargetInvocationException: Het doel van een aanroep heeft een uitzondering veroorzaakt. ---> System.InvalidOperationException: De Microsoft.ACE.OLEDB.12.0-provider is niet geregistreerd op de lokale computer.
...


Webmaster
User
Posts: 9425

Post by Webmaster »

As the error message said:
System.InvalidOperationException: The Microsoft.ACE.OLEDB.12.0 provider is not registered on the local computer.

If you use x86 version of dotnet, you need to use 32bit (x86) version of Microsoft Access Database Engine. Likewise the x64 version. If you use JET 4.0, it is x86 only.

Open comamnd prompt and enter:

dotnet --info

to check your current version of dotnet.

If you install both x86 and x64 version of dotnet, check your "Path" environment variable, make sure the version you want to use to prior than the other version.


dvandenbossche
User
Posts: 18

Post by dvandenbossche »

How I solved this problem:

Uninstall the x64 version of ASP NET Core 1.0.3.
Install of the x86 version of ASP.NET Core 1.0.3.

Afther this it was possible to generate and view the webpages.


Webmaster
User
Posts: 9425

Post by Webmaster »

Webmaster wrote:
If you use x86 version of dotnet, you need to use 32bit (x86) version of Microsoft Access Database Engine. Likewise the x64 version. If you use JET 4.0, it is x86 only.

If you use x86 version of database providers, you can only use x86 version of dotnet to suit them.

If you install x64 version of database providers, you can use x64 version of dotnet with ASP.NET Maker 2016.

Unfortunately, there is no x64 version of database providers for older versions of Access (< Access 2010).


dvandenbossche
User
Posts: 18

Post by dvandenbossche »

You are probably right.
But we think there are problems with dotnet core x64 and access x64.
Maybe there was a mismatch between x64 and x86 installations, but after all it is now working but only with dotnet x86.
I think you must try ASP NET Maker on a brand new windows 10 x64 machine with Access x64 and see what happens.


Webmaster
User
Posts: 9425

Post by Webmaster »

Webmaster wrote:
If you install x64 version of database providers, you can use x64 version of dotnet with ASP.NET Maker 2016.
Unfortunately, there is no x64 version of database providers for older versions of Access (< Access 2010).

"Brand new windows *" or not is irrelevant. It is just that you cannot use x64 (64bit) dotnet with x86 (32bit) database drivers. If your Access database is < Access 2010, you only have x86 version of database provider available from Microsoft and therefore you must use x86 version of dotnet. If your Access database is >= Access 2010 and you have installed the corresponding x64 version of Microsoft Access 2010/2013/2016 Redistributable/Runtime, then you can use x64 version dotnet.


dvandenbossche
User
Posts: 18

Post by dvandenbossche »

Ok, one last issue: on the x64 versions Windows ASP.NET Maker gives an error at startup or synchronize :
Unable to load database information! Reason: DAO Error: 3343
(DAO.Workspace)
Description: Unredognized database format 'C/..... vap2016.accdb'.
Please check if correct database is in use.

Click OK and tables and fields are loaded.
But why the error? I was told that it is because of the use of provider ....ACE.OLEDB.12.0. and not ACE.OLEDB.14.
If this is the case is it possible to change it to ACE.OLEDB.14 or is this not the correct reason of the error?

It was only possible to generate and view the site because nothing was changed in the database.
If field attributes are changed or there are new tables, these changes are not loaded in ASP NET Maker.


Webmaster
User
Posts: 9425

Post by Webmaster »

Microsoft.ACE.OLEDB.12.0 should be able to open Access 2007-2016. We have tested that ASP.NET Maker opens and syncs Access 2016 database fine. The limitation is, while Microsoft allows user to install both x86 and x64 versions of ASP.NET Core, it only allows user to install either x86 or x64 version of Access runtime (although you can google some workarounds to install both). ASP.NET Maker is a 32 bit application, so you need to use the x86 version of database drivers to connect to the database. If you want to compile the generated scripts with x64 dotnet and x86 Access runtime, dotnet compiler raises error.

If for some reasons you must use x64 version of Access runtime on your production server (note that x64 version does not necessarily mean better performance), you can only use x86 version of Access runtime on your PC so you can use ASP.NET Maker to generate and compile project automatically during development. When you want to deploy/publish the project, generate scripts to other machine with x64 version of Access runtime and run build.bat manually.


Post Reply