zeekjw
zeekjw

Reputation: 23

VB.NET app and Access database: Do I need to deploy the Access Runtime?

I have a VB.NET application that uses a .accdb access file (2010 version) as a backend. The application only reads from this DB file, no writing ever. The application and database file need to be deployed together on the user's PC.

I understand that users will need either: 1) Full version of Access installed already or 2) The runtime installed

in order for the application to run.

That's fine and dandy but my problem is that the AccessRuntime.exe is HUGE (175 MB) and I would rather not deploy it with my app if I don't have to. Is there a way to just deploy the needed Runtime DLLs/files with my VB app and DB file? If so, what/where are these files located?

Upvotes: 2

Views: 3647

Answers (1)

Gord Thompson
Gord Thompson

Reputation: 123799

If your .NET application will just be reading the Access database file via System.Data.OleDb or System.Data.Odbc then you don't need the Microsoft Access Runtime. You just need to have an Access database engine installed, either

  • the older "Jet" database engine, if you only need to access .mdb files from 32-bit applications, or
  • the newer "ACE" database engine if you need to access .accdb files (or .mdb files from a 64-bit application).

Since your database apparently does not need any specific Access 2010 features you can just convert your .accdb file to an .mdb file and use the "Jet" database engine that is already installed on all Windows machines. However, Jet is only available to 32-bit applications so you need to go into your VB.NET project and target it to the x86 platform so it will always run as a 32-bit application (even on 64-bit machines).

Edit

If you want to manipulate an .accdb database file then you need to ensure that the Access Database Engine ("ACE") is installed on each machine. The installer is available for download here:

Microsoft Access Database Engine 2010 Redistributable

Notes:

  1. There are both 32- and 64-bit versions of the ACE database engine. The installed version must match the "bitness" of your application (32-bit or 64-bit). This can be tricky, because Microsoft has designed the ACE installers so that you can have either the 32-bit or the 64-bit version installed. (There is a workaround that can force-install both, but it is not recommended because it can break Microsoft Office.)

  2. Further to point #1, so even if you target your .NET app to the x86 platform and require the 32-bit version of ACE you can still have difficulties dealing with target machines that already have the 64-bit version of Office installed. They cannot install the 32-bit version of ACE because the 64-bit version is already installed. So, to use your app they would have to uninstall the 64-bit version of Office and install the 32-bit version.

  3. As far as I know there is no practical way to include the ACE installer in the setup program for your application. Your users would need to download and install the appropriate version (from the link above) for themselves.

Upvotes: 1

Related Questions