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
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..?
解决方案
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.