I have written a C# WPF desktop application using ODBC connections via connection strings (no user DSN) like:
Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=D:\Data\example\test.accdb;
There are several ODBC drivers (all 32 bit) in use so far, as the application is used in a Windows 7 32 bit environment.
I have now compiled the application in "Any CPU" mode to be able to address 64 bit drivers in 64 bit environments. Just to keep being able to use 32 bit drivers I compiled a second version in "x86" mode, which can be used in 64 bit environments to address 32 bit ODBC drivers.
Is it possible to support 32/64 Bit ODBC drivers in 64 bit environments without having two versions (x86 and x64/Any CPU). My goal is to compile only an "Any CPU" version. Is there a method to force the application at runtime (dynamically) to run in 32 bit / 64 bit mode by c# code or by standard windows scripting?
Corflags does not seem a solution as it is not available in target environments at customer site...