I am looking for a solution in the internet, found a lot of proposed solutions but no one worked for me.
That is my situation :
My code is :
import pyodbc
conn = pyodbc.connect(
r'Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:\Users\User\Documents\MonCommerce.accdb;')
cursor = conn.cursor()
cursor.execute('select * from client')
for row in cursor.fetchall():
print(row)
The error is (in french) :
conn = pyodbc.connect(
pyodbc.InterfaceError: ('IM002', '[IM002] [Microsoft][Gestionnaire de pilotes ODBC] Source de données introuvable et nom de pilote non spécifié (0) (SQLDriverConnect)')
It means :
ODBC driver error. Untraceable data source and driver name not specified
- My computer has Windows 7 Profesional SP1 64bit,
- My Python is 3.8.2 64bit.
- I am writing my code into PyCharm 2019.3.4 Community Edition,
- My database is a Microsoft Access 2007
- In Windows directory, I have both System32 and SysWOW64 directories.
The driver "Microsoft Access Driver (*.mdb, *.accdb)" is located into SysWOW64\odbcad32.exe. How the connection string did not find it ?
I have installed Python from the executable : python-3.8.2-amd64.exe, but when run the command "python" in the PyCharm Terminal, it gives me :
Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] on win32
How it can be win32 ?