my Python code:
import pyodbc
cnxn = pyodbc.connect('DRIVER=FreeTDS;DSN=S29;UID=test;PWD=test;TDS_Version=8.0;ClientCharset=UTF8')
cursor = cnxn.cursor()
cursor.execute("select user_id, user_name from users")
rows = cursor.fetchall()
for row in rows:
print row.user_id, row.user_name
Get error:
Traceback (most recent call last):
File ".../test_mssql_connect.py", line 4, in <module>
cnxn = pyodbc.connect('DRIVER=FreeTDS;DSN=S29;UID=test;PWD=test;TDS_Version=8.0;ClientCharset=UTF8')
pyodbc.Error: ('HY000', '[] (20013) (SQLDriverConnect)')
I can not find the information, what is this error ('HY000', '[] (20013) (SQLDriverConnect)') and how to fix it.
At the same time through tsql, osql and isql I successfully connected to the base
my odbc.ini
[S29]
Driver=FreeTDS
Description=S29
ServerName=192.168.0.29
Database=test
UID=test
PWD=test
TDS_Version=8.0
my odbcinst.ini
[FreeTDS]
Description=FreeTDS
Driver=/usr/local/Cellar/freetds/0.95.1/lib/libtdsodbc.so
Setup=/usr/local/Cellar/freetds/0.95.1/lib/libtdsodbc.so
UsageCount=2
CPTimeout =
CPReuse =
TDS Version = 8.0
client charset = utf-8
my freetds.conf
[global]
tds version = 8.0
[192.168.0.29]
host = 192.168.0.29
port = 1433
tds version = 8.0
[S29]
host = 192.168.0.29
port = 1433
tds version = 8.0