I have python 2.7 32 bit running on a Windows 8.1 64 bit machine.
I have Access 2013 and a .accdb file that I'm trying to access from python and pyodbc.
I can create a 64 bit DSN in the 64 bit ODBC manager. However, when I try to connect to it from python, I get the error:
Error: (u'IM002', u'[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified')
Presumably, python is only looking for 32-bit DSNs and doesn't find the 64-bit one that I've created.
When I try to create a 32-bit DSN within the 32-bit ODBC manager, there is no driver for a accdb file (just .mdb).
I think I need a 32 bit ODBC driver for Access 2013 files (.accdb), but haven't been able to find one.
Is it possible to do what I'm trying to do? -- 32bit python access a Access 2013 .accdb file?
32 bit applications including Python can work only with 32 bit ODBC drivers.
64 bit applications including Python can work only with 64 bit ODBC drivers.
If you have:
pyodbc
moduleThen you must change something:
odbc
module), then you can use 64 bit version of pyodbc
module (I see it for Python 2.6, 2.7 and 3.3)Using pyodbc.dataSources()
you can list ODBC sources:
sources = pyodbc.dataSources()
dsns = list(sources.keys())
dsns.sort()
sl = []
for dsn in dsns:
sl.append('%s [%s]' % (dsn, sources[dsn]))
print('\n'.join(sl))
If you use ActiveState Python then you can list them using odbc
module as in my recipe: http://code.activestate.com/recipes/578782-printing-list-of-odbc-data-sources/?in=user-186902
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