FreeTDS - tsql connects, isql fails

余生颓废 提交于 2019-12-06 00:48:51

问题


I'm trying to connect to a database on my host machine (windows xp, sql server 05). My guest machine is Ubuntu 10.04. I can connect and execute commands with tsql, but isql fails. Below are my config files and error messages.

freetds.conf

text size = 64512

[SQLEXPRESS]
host = 192.168.163.1
port = 1433
tds version = 7.0

odbcinst.ini

[FreeTDS]
Description     = TDS driver (Sybase/MS SQL)
Driver          = /usr/lib/odbc/libtdsodbc.so
Setup           = /usr/lib/odbc/libtdsS.so
CPTimeout       =
CPReuse         =
FileUsage       = 1

odbc.ini

[SQLEXPRESS]
Driver          = FreeTDS
Description     = ODBC connection via FreeTDS
Trace           = No
Servername  = 192.168.163.1
Database        = SCOPE_Peel
Port        = 1433
UID         = sa
PWD         = test1234
ReadOnly    = No

tsql:

tsql -S SQLEXPRESS  -U sa
#success

isql:

isql SQLEXPRESS sa test1234 -v
[S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source
[ISQL]ERROR: Could not SQLConnect

回答1:


The issue was this line in odbc.ini

Servername = 192.168.163.1

It should have been SQLEXPRESS which I think points to the name of the server configured in freetds.conf



来源:https://stackoverflow.com/questions/8010361/freetds-tsql-connects-isql-fails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!