Is it possible for 64-bit pyodbc to talk to 32-bit MS access database?

user3848207 picture user3848207 · Aug 29, 2017 · Viewed 9.5k times · Source

I am using 64-bit python anaconda v4.4 which runs python v3. I have MS Access 2016 32-bit version. I would like to use pyodbc to get python to talk to Access. Is it possible to use 64-bit pyodbc to talk to a MS Access 2016 32-bit database?

I already have a number of python applications running with the 64-bit python anaconda. It will be a chore to downgrade to 32-bit python.

Answer

agcala picture agcala · Jan 16, 2019

Yes you can:

Just install

AccessDatabaseEngine_X64.exe /passive

(which contains both the x86 and x64 version of the drivers) and you will be okay. Do not forget the /passive option because if you do it won't install unless you have MS Office 2010 installed as well. You can download the file from the Microsoft Access Database Engine 2010 Redistributable site

After you install AccessDatabaseEngine_X64.exe you should run the following code on your python shell to test everything's okay:

import pyodbc
[x for x in pyodbc.drivers() if x.startswith('Microsoft')]

and you should get a printout like

['Microsoft Access Driver (*.mdb, *.accdb)',
 'Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)',
 'Microsoft Access dBASE Driver (*.dbf, *.ndx, *.mdx)', 
 'Microsoft Access Text Driver (*.txt, *.csv)']

Take care.