Error in opening an Access database in python
Asked Answered
C

2

3

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..?

Coralline answered 13/7, 2012 at 15:38 Comment(2)
@Gord Thompson : I wonder how can a question asked two years ago could possibly duplicate of a question which was asked 7 days ago ??Coralline
I was trying to point future readers to a more complete answer to this question. (See my comment to the answer.) I have reopened the question.Infirmary
J
2

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.

Jaborandi answered 13/7, 2012 at 15:45 Comment(1)
For future readers: This is only one possible cause of the error message, and a relatively uncommon one at that. Other causes and solutions are outlined in another answer here.Infirmary
C
0

try to uncheck Attributes: Read-only box in file properties.

Chibcha answered 30/5, 2018 at 13:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.