[freetds] Adaptive Server connection failed (Php + freetds)

James K. Lowden jklowden at freetds.org
Thu Jun 19 22:05:01 EDT 2008

Frederick William Borges Pohl wrote:
> ./tsql -H <ip_address> -p 1433 -U <username>
> The result was:
> locale is "en_US.UTF-8"
> locale charset is "UTF-8"
> Msg 20009, Level 9, State -1, Server OpenClient, Line -1
> Unable to connect: Adaptive Server is unavailable or does not exist

You're probably not using the right TDS version.  When you use "tsql -H",
you're bypassing freetds.conf.  The TDS version used depends on the
built-in options (which you can check with "tsql -C").  

Since you're using --with-mssql, I suppose you're connecting to a
Microsoft server, so you want:

	$ TDSVER=7.0 ./tsql -H ip_addr -p 1433 -U user

or, better, 

	$ ./tsql -S servername -U username

TDSDUMP and TDSDUMPCONFIG should tell you anything else you need to know. 



More information about the FreeTDS mailing list