连接

2024-06-30 14:50:58 发布

您现在位置:Python中文网/ 问答频道 /正文

它为我提供了dns、用户和密码。我需要用python连接到服务器。我试过以下方法:

import odbc

db=odbc.odbc ('dns/user/password')

我犯了以下错误:

 opError                                   Traceback (most recent call last)
<ipython-input-16-3d62013ed089> in <module>
----> 1 db=odbc.odbc ('dns')

opError: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified in LOGIN

Tags: 方法用户inimport服务器密码mostdb