[Chicago] pyodbc to ms access

Aaron Elmquist elmq0022 at umn.edu
Mon May 9 07:24:05 EDT 2016


Does anyone have some advice or insight on connecting to an MS Access
Database using python?

Here's my info:

Connection String:

    r'DRIVER={Microsoft Access Driver (*.mdb,
*.accdb)};DBQ=C:\Path\to\DB\db.mdb;'

Python Version:

    Python 3.5.1 :: Continuum Analytics, Inc. - 64 bit

OS

    Windows 7

Office

    32 Bit
Here's my error:
    Error: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source
name not found and no default driver specified (0) (SQLDriverConnect)')

but...

pyodbc.dataSources() returns:
    {'Excel Files': 'Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm,
*.xlsb)',
     'MS Access Database': 'Microsoft Access Driver (*.mdb, *.accdb)',
     'dBASE Files': 'Microsoft Access dBASE Driver (*.dbf, *.ndx, *.mdx)'}

Do I need to use a 32 bit python to get this done?
Can I specify the python bits version to use in a specific conda env?

Thanks,

Aaron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20160509/87391ef9/attachment.html>


More information about the Chicago mailing list