0

This question has been asked before (see link below) but I'm still having issues even though both my Python and MS Office are 64-bit. After ensuring both are 64-bit, I tried running the following code:

conn = pyodbc.connect(r'Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=Q:\Data Requests\Boarding.accdb;')

but still got the following error:

InterfaceError: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')

Also of note, I am able to connect and pull data into Python from my SQL server just fine using this code:

conn = pyodbc.connect('Driver={SQL Server};'
                      'Server=ENTSNR;'
                      'Database=EMData;'
                      'Trusted_Connection=yes;')

enter image description here

enter image description here

enter image description here

PYODBC--Data source name not found and no default driver specified

Raven
  • 849
  • 6
  • 17
  • I see you're working using jupyter, you're running that locally, right? Can you just output pyodbc.drivers(), without that filter? – Erik A Oct 07 '20 at 17:05
  • Correct, I am running in Jupyter and locally! What do you mean by output pyodbc.drivers(), without that filter? Thanks!! – Raven Oct 07 '20 at 17:10
  • 2
    @Raven - just `print(pyodbc.drivers())` – Gord Thompson Oct 07 '20 at 17:23
  • That returns: ['SQL Server'] – Raven Oct 07 '20 at 17:35
  • 1
    That's truly odd. You're 100% sure you're running this locally, connecting to Jupyter using localhost as the address? Only having that driver sounds an awful lot like a managed installation, there are nearly always more drivers present by default. – Erik A Oct 07 '20 at 17:47
  • @ErikA Is there an easy was to determine if I'm running Juptyer locally(my IT dept installed it for me)? – Raven Oct 07 '20 at 17:55
  • 1
    You can do `import socket` then `socket.gethostname()`, and compare that to your PC hostname, for example. – Erik A Oct 07 '20 at 18:00
  • Hmm the output from the code you detailed above matches my device name. – Raven Oct 07 '20 at 18:10
  • 1
    Well, I'm at a loss then. You can double-check architecture as well if you haven't set it up yourself, `import platform` then `platform.architecture()`, – Erik A Oct 07 '20 at 18:18
  • thanks for trying! It still says 64-bit! – Raven Oct 07 '20 at 18:22

0 Answers0