[Chicago] pyodbc to ms access

Noah Schultz noah_schultz at oxfordcorp.com
Mon May 9 08:17:55 EDT 2016


First, he is on the right path about the  32 bit vs 64 bit issue. Second, ms access is weak sauce and he should use a much more robust db with better python integration.

Sent from my iPhone

On May 9, 2016, at 7:04 AM, Jeremy McMillan <jeremy.mcmillan at gmail.com<mailto:jeremy.mcmillan at gmail.com>> wrote:


You probably need to exhume a "Jet" db file format parser. Take a deep breath. Maybe there's ODBC, but probably not.

On Mon, May 9, 2016, 06:29 Aaron Elmquist <elmq0022 at umn.edu<mailto:elmq0022 at umn.edu>> wrote:

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
_______________________________________________
Chicago mailing list
Chicago at python.org<mailto:Chicago at python.org>
https://mail.python.org/mailman/listinfo/chicago
_______________________________________________
Chicago mailing list
Chicago at python.org<mailto:Chicago at python.org>
https://mail.python.org/mailman/listinfo/chicago

The information transmitted, including attachments, is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this e-mail in error, please notify the sender immediately by replying to the message and deleting the material from your computer.


More information about the Chicago mailing list