How can I use the 32bit MS access driver for odbc connection in python 64bit?
Can it be done by altering the environment handle or odbc constants in pypyodbc, or creating a bit conversion file?
Another thought (not sure if possible): Is there a way to switch to a 32bit python.exe during code-execution (JUST for when a user wants to pull access database)? Essentially something like...
if access api called and struct.calcsize("P") == 8:
open python 32bit interpreter and connect to 32bit driver
Open to all solutions...Thanks
Articles, forums, and SO Posts are abound on this topic.
Succinctly put, you cannot connect (at application level) a 64-bit Python.exe to a 32-bit MS Access ODBC driver (odbcad32.exe) since simply data is stored and processed differently between the types. However with backwards compatibility, it is advised to work in lowest common denominator as a 64-bit OS can run 32-bit applications and same level programs can "talk" to each other.
As for a dynamic setting to switch modes, this may be a very extensive workaround as the 32-bit python.exe and 64-bit python.exe are essentially distinct installed applications with packages like pypyodbc corresponding to each other. So above installing both versions, you would need to script with either:
struct.calcsize("p");External applications will need to select which version will run the python script based on installed ODBC driver, looking at registry key as indicator, or variable type size. This may also require creating path variables to both python.exe versions and be assured they do not conflict with each other, selecting one as default.
Many choose to deploy two versions of application depending on users' CPU environment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With