Skip to Content.
Sympa Menu

freetds - Re: [freetds] isql connects, tsql does not

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Bernard Moreton <itman AT tnauk.org.uk>
  • To: jklowden AT schemamania.org
  • Cc: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] isql connects, tsql does not
  • Date: Fri, 20 Jan 2012 13:42:13 +0000

1
Found a bug in osql (Ubuntu 11.10 Server), corrected in local copy, got reasonable results; in consequence set Servername=<NAME> in .odbc.ini.

2
freetds.conf defines [global] tds version = 7.1 (for SQLServer 2000 8.00)
.odbc.ini sets TDS_version = 8.0
TDSVER not set
TDSDUMP shows
log.c:190:Starting log file for FreeTDS 0.82
on 2012-01-20 13:36:40 with debug flags 0x4fff.
iconv.c:197:names for ISO-8859-1: ISO-8859-1
iconv.c:197:names for UTF-8: UTF-8
iconv.c:197:names for UCS-2LE: UCS-2LE
iconv.c:197:names for UCS-2BE: UCS-2BE
iconv.c:363:iconv to convert client-side data to the "UTF-8" character set
iconv.c:516:tds_iconv_info_init: converting "UTF-8"->"UCS-2LE"
net.c:210:Connecting to 192.168.1.14 port 1433 (TDS version 4.2)
net.c:264:tds_open_socket: connect(2) returned "Operation now in progress"
net.c:303:tds_open_socket() succeeded
util.c:162:Changed query state from DEAD to IDLE
login.c:537:NT login not support using TDS 4.x or 5.0
util.c:162:Changed query state from IDLE to DEAD
util.c:334:tdserror(0x95830d8, 0x95839e0, 20002, 0)
util.c:368:tdserror: client library returned TDS_INT_CANCEL(2)
util.c:389:tdserror: returning TDS_INT_CANCEL(2)
mem.c:563:tds_free_all_results()

3
If I amend .odbc.ini to use TDS_version = 7.1, then the same happens.

4
export TDSVER=7.1
TDSDUMP shows
log.c:190:Starting log file for FreeTDS 0.82
on 2012-01-20 13:27:52 with debug flags 0x4fff.
iconv.c:197:names for ISO-8859-1: ISO-8859-1
iconv.c:197:names for UTF-8: UTF-8
iconv.c:197:names for UCS-2LE: UCS-2LE
iconv.c:197:names for UCS-2BE: UCS-2BE
iconv.c:363:iconv to convert client-side data to the "UTF-8" character set
iconv.c:516:tds_iconv_info_init: converting "UTF-8"->"UCS-2LE"
net.c:210:Connecting to 192.168.1.14 port 1433 (TDS version 4.2)
net.c:264:tds_open_socket: connect(2) returned "Operation now in progress"
net.c:303:tds_open_socket() succeeded
util.c:162:Changed query state from DEAD to IDLE
login.c:537:NT login not support using TDS 4.x or 5.0
util.c:162:Changed query state from IDLE to DEAD
util.c:334:tdserror(0x9a880d8, 0x9a889e0, 20002, 0)
util.c:368:tdserror: client library returned TDS_INT_CANCEL(2)
util.c:389:tdserror: returning TDS_INT_CANCEL(2)
mem.c:563:tds_free_all_results()


5
It seems that only the compiled-in TDS version is operative?


Bernard Moreton
IT Director, National Talking Newspapers and Magazines (TNAUK)
Charity registered in the UK 293656

DDI: 01 435 869 316

On 19/01/2012 20:02, jklowden AT schemamania.org wrote:
On Thu, Jan 19, 2012 at 04:13:42PM +0000, Bernard Moreton wrote:
Resetting 'TDS version' lines in freetds.conf appears to make no difference.
Setting TDSVER on the command line makes no difference to the output
of tsql -C, nor does exporting TDSVER.

As the tsql man page and the output both say, the -C option shows the
compile-time settings. It doesn't show the effect of environment variables
or configuration files. The point is to show what you get if you don't
override it somehow. (It would be nice to have a more convenient way to show
those effects, but no one has created one.)

The easiest way to test for those effects is TDSDUMP. The top of the file
shows the the connection information.

$ grep -n Connecting ~/dump
25:net.c:203:Connecting to 99.99.99.99 port 13461 (TDS version 7.1)

$ tsql -S tnauk-sql -U TNAUKNRC\\Bernard -D tnauk
...
Password:
Default database being set to tnauk
Msg 20002, Level 9, State -1, Server OpenClient, Line -1
Adaptive Server connection failed
There was a problem connecting to the server

- so I seem to have got connection to the database, but password refusal.

A rejected password usually provokes a message about a rejected password. You
would not see the changing-database message if you weren't allowed to log in.

I would think the problem is your account is not allowed to use the "tnauk"
database. Especially if no database name appears in your odbc.ini.

I have a working setup on an elderly DEBIAN server, where also tsql will not
work, though isql does

If tsql does not work, the freetds.conf is not right. The odbc setup is
either ODBC-only or DSN-less.

If I may, you seem to be working to isolate the behavior by experimentation.
I think you will find easier just to read the User Guide and walk through the
setup steps. The osql utility may be helpful in reporting what each client
is doing to find its server.

HTH.

--jkl





Archive powered by MHonArc 2.6.24.

Top of Page