1

My code:

connection_string = (r'DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:\\Users\\Bob-Admin\\Documents\\MyDatabase.accdb;')
cnxn = pyodbc.connect(connection_string, autocommit=True)
crsr = cnxn.cursor()

My error:

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

Environment Details:

  1. Windows 10

  2. Office 2016

  3. 64-bit Access 2016

  4. 64-bit Python 3.7.3

  5. 64-bit and 32-bit Microsoft Access Driver (*.mdb, *.accdb)

  6. pyodbc 4.0.27

I've looked through all the older connection issues posts, none match these environmental parameters. Any new thoughts?

Justin
  • 65
  • 5

1 Answers1

1

FYI just because Microsoft Access Database Driver shows up in your ODBC Data Source Administrator window does not necessarily mean it's installed. I went ahead and downloaded from Microsoft website; magically, it began working. Solved.

Justin
  • 65
  • 5