1

I am just starting to work with pyodbc to analyze an MS Access .accdb file. My code is like this.

import pyodbc
conn_str = (
r'DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};'
r'DBQ=C\Users\Users\:::::\PycharmProjects\Football\Football_ball_touch.accdb;'
r'PWD=:::::::'
)
cnxn = pyodbc.connect(conn_str)
crsr = cnxn.cursor()
for table_info in crsr.tables(tableType='TABLE'):
print(table_info.table_name)

And I keep getting the following error message.

Traceback (most recent call last):
File "C:/Users/::::::/PycharmProjects/Football/Football.py", line 62, in <module>
cnxn = pyodbc.connect(conn_str)
pyodbc.Error: ('HY000', "[HY000] [Microsoft][ODBC Microsoft Access Driver]\x88\xea\x94\xca\x83G\x83\x89\x81[ \x83\x8c\x83W\x83X\x83g\x83\x8a \x83L\x81[ 'Temporary (volatile) Ace DSN for process 0x266c Thread 0x135c DBC 0xd85b63c                                                              Jet' \x82\xf0\x8aJ\x82\xad\x82\xb1\x82\xc6\x82\xaa\x82\xc5\x82\xab\x82\xdc\x82\xb9\x82\xf1\x81B (63) (SQLDriverConnect)")
Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
user8591280
  • 69
  • 1
  • 5

0 Answers0