Many thanks for your answer.
How do I utilise either the 32 bit or 64 bit installation of the Microsoft Access database Engine.
I have a 32bit Visual Basic program running on a 64bit workstation that imports XL data using a 32 bit Access database Engine.
We have to replace all of the 32 bit Access installations with 64 bit access database engines over two years, so some workstations will have the 32 bit Access Database Engine and some the 64 bit Access Database Engine.
How do I modify my program to work with the 32 bit or 64bit Access database Engine, depending on whichever is present?
We have some 5,000 workstations so replacing the 32 bit access database Engine with the 64 bit Access database Engine over night is not a likely scenario.
Developer technologies | Visual Basic for Applications
1 additional answer
Sort by: Most helpful
-
Michael Taylor 60,326 Reputation points
2021-08-05T14:53:10.703+00:00 I presume that your app is a VB.NET app and that you're compiling for Any CPU. The default behavior in this case is to run as x86 even on x64 machines. Thus you are in a tough situation here. There really isn't a good workaround because your app is going to run as x86 even on Win64, as you want it to. If you were to disable this behavior then suddenly your app would be running x64 on Win64 (your future goal) but you haven't yet updated the drivers.
I'm curious if your admin team has worked around the issue that you cannot install Access x64 Database Engine with the standard Office x86 installed. Either you aren't using Office (which means you don't need Access) or you are also upgrading at the same time to x64 of Office (which means some addins won't work anymore). There is a way to install the Access x64 Database Engine with Office x86 installed (and hence you will have both x86 and x64 Access drivers installed as documented in several places.
My personal thought is that you should leave your app unchanged and targeting x86 (with Access x86 driver) until all the machines have been updated to x64. Then change the compiler flag to not prefer x86, recompile and redeploy your app. Then you are using the Access x64 driver (assuming you set up DSN correctly) and can remove the x86 Access driver at your leisure.
If that isn't an option for some reason then you have little flexibility. At this point I would set up your build process to build both an x86 and x64 version of your app explicitly. They should produce different binaries in different directories (e.g. myapp_x86, myapp_x64). Then create an Any CPU app that has the same name as your main program (e.g. myapp) now. This bootstrapper program looks to see if the x64 Access driver is available. If it is then it starts the x64 version of your real app otherwise it starts the x86 version instead. Redeploy your app and users will be running one or the other depending on situation.
When the upgrade is finally complete you can revert back to just the single app for x64 without the bootstrapper and no one will know.