我可以连接到在 Windows 7 上本地运行我的pypyodbc的 cygwin 兼容分支的系统 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 驱动程序的其他数据库。