Re: isql connects, tsql does not

[email protected]
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.