我正在使用pyodbc使用python 2.7访问MSaccess数据库。我在osx10.9上的parallels v10上运行Windows 7。我正在使用以下代码来测试它:
DBfile = 'c:\\dir\\testdb.db'
conn = pyodbc.connect('DRIVER={Microsoft Access Driver (*.mdb)};DBQ='+DBfile)
并且似乎找不到MSAccess驱动程序,导致以下错误:
> Traceback (most recent call last): File "C:/Projects/DBtest.py",
> line 6, in <module>
> conn = pyodbc.connect('DRIVER={Microsoft Access Driver (*.mdb)};DBQ='+DBfile) Error: ('HY024', "[HY024] [Microsoft][ODBC
> Microsoft Access Driver] '(unknown)' is not a valid path. Make sure
> that the path name is spelled correctly and that you are connected to
> the server on which the file resides. (-1023) (SQLDriverConnect);
> [01000] [Microsoft][ODBC Microsoft Access Driver]General Warning
> Unable to open registry key 'Temporary (volatile) Jet DSN for process
> 0x590 Thread 0xa50 DBC 0x2c9389c Jet'. (1); [01000] [Microsoft][ODBC
> Microsoft Access Driver]General Warning Unable to open registry key
> 'Temporary (volatile) Jet DSN for process 0x590 Thread 0xa50 DBC
> 0x2c9389c Jet'. (1); [HY024] [Microsoft][ODBC Microsoft Access Driver]
> '(unknown)' is not a valid path. Make sure that the path name is
> spelled correctly and that you are connected to the server on which
> the file resides. (-1023)")
我在SO上看不到任何涉及此问题的内容,但我是ODBC的新手,对SO来说还是新手,如果我忽略了任何东西,那么道歉。有没有人有任何想法?
干杯