Python 在mac上的windows并行上查找msaccess驱动程序时出错

Python 在mac上的windows并行上查找msaccess驱动程序时出错,python,ms-access,pyodbc,parallels,Python,Ms Access,Pyodbc,Parallels,我正在使用pyodbc访问使用Python2.7的MSaccess数据库。我在osx10.9上并行运行Windows7和v10。我正在使用以下代码对其进行测试: DBfile = 'c:\\dir\\testdb.db' conn = pyodbc.connect('DRIVER={Microsoft Access Driver (*.mdb)};DBQ='+DBfile) 并且它似乎找不到MSAccess驱动程序,导致以下错误: > Traceback (most recent ca

我正在使用pyodbc访问使用Python2.7的MSaccess数据库。我在osx10.9上并行运行Windows7和v10。我正在使用以下代码对其进行测试:

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新手,如果我忽略了任何内容,我将表示歉意。有人有什么想法吗


Cheers

os.path.isfileDBfile是否返回True?hmmm否。mdb文件与.py脚本位于同一文件夹中。删除文件路径似乎解决了这个问题。在OSX中运行时,这不是一个问题,因为在我的最终版本中,路径将不同,所以有什么技巧可以解决这个问题吗?很抱歉,我觉得我遗漏了一些明显的东西,如果是这样的话,请原谅我的无知!