Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in opening an Access database in python

I am a new to python programming and i want to write a python program to read and write data to and from the database.

The connection code is as follows:

DNS='catalog'
DRV = '{Microsoft Access Driver (*.mdb)}'
conn = pyodbc.connect('DRIVER=%s;DSN=%s;' % (DRV,DNS))

catalog is the DSN name.

I am am getting the following error:

Traceback (most recent call last):
File "C:\Python27\exampes\xxx.py", line 8, in <module>
conn = pyodbc.connect('DRIVER=%s;DSN=%s;' % (DRV,DNS))
Error: ('01000', "[01000] [Microsoft][ODBC Microsoft Access Driver]General Warning  Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x12b4 Thread 0x1544  DBC 0x567ea4 Jet'. (1) (SQLDriverConnect);
[01000] [Microsoft][ODBC Microsoft Access  Driver]General Warning Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x12b4 Thread 0x1544 DBC 0x567ea4 Jet'. (1)"

Can anyone please help me..?

like image 939
heretolearn Avatar asked May 02 '26 06:05

heretolearn


1 Answers

The account under which you are running is not an administrator. It needs registry access as per the message (also described here)

Registry access is needed to find the ODBC driver for MS Access.

like image 146
Jirka Hanika Avatar answered May 04 '26 18:05

Jirka Hanika