我可以在Windows 7上本地连接到运行my cygwin compatible fork pypyodbc {{3}}的系统DSN,但当我尝试通过SSH / Fabric运行相同的脚本时,我收到权限错误:
[192.168.x.x] out: conn = pyodbc.connect('DSN=xxx;PWD=xxx')
[192.168.x.x] out: File "/home/tschmidt/.virtualenvs/dashboard/src/pypyodbc/pypyodbc.py", line 2081, in __init__
[192.168.x.x] out: self.connect(connectString, autocommit, ansi, timeout, unicode_results, readonly)
[192.168.x.x] out: File "/home/tschmidt/.virtualenvs/dashboard/src/pypyodbc/pypyodbc.py", line 2129, in connect
[192.168.x.x] out: validate(ret, SQL_HANDLE_DBC, self.dbc_h)
[192.168.x.x] out: File "/home/tschmidt/.virtualenvs/dashboard/src/pypyodbc/pypyodbc.py", line 989, in validate
[192.168.x.x] out: ctrl_err(handle_type, handle, ret)
[192.168.x.x] out: File "/home/tschmidt/.virtualenvs/dashboard/src/pypyodbc/pypyodbc.py", line 974, in ctrl_err
[192.168.x.x] out: raise Error(state,err_text)
[192.168.x.x] out: pypyodbc.Error: ('HY000', "[HY000] [Microsoft]
[ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot
open the file '(unknown)'. It is already opened exclusively by another user,
or you need permission to view its data.")
使用MDBTools不是一个选项,因为我需要连接到只有Windows驱动程序的其他数据库。
答案 0 :(得分:0)
我能够通过切换到Windows XP来解决这个问题。但是仍然想知道问题的原因是什么。 Windows 7中的新权限我假设。