通过python连接到MS-SQL数据库时出错

时间:2016-02-11 11:46:47

标签: python sql-server pyodbc

使用pyodbc模块通过python连接到MS-SQL Server时如何克服以下错误?

Traceback (most recent call last):
  File "test_db.py", line 2, in <module>
    cnxn = pyodbc.connect(r'Driver={SQL Server};Server=.\ITRES-PRD-SQL-1;Database=testdb;Trusted_Connection=yes;')
pyodbc.Error: ('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not found, and no default driver specified (0) (SQLDriverConnect)')

0 个答案:

没有答案