Re: osql error

[email protected]
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
On Wed, Apr 14, 2010 at 12:45:38PM -0700, Lee Hughes wrote:
> 
> Thanks for the tip. I did as you instructed and installed osql from the
> latest snapshot. This got me much further with troubleshooting, very nice
> tool.

Glad to be of service.  I wrote it to help people diagnose ODBC
setup problems.  The more systems it works on, the fewer people have to 
write to the mailing list just to get started.  

> I now have tsql, isql, and OpenOffice successfully connecting to my SQL
> Server. But I cannot connect with osql or ruby-odbc which is my end goal.
> 
> osql fails with
> 
> "Server" found, not using freetds.conf
> Server is "192.168.1.101"
> looking up hostname for ip address 192.168.1.101
> osql: warning: no DNS hostname found for "192.168.1.101"
> 
> I have an entry in /etc/hosts for this IP address

Evidently your host(1) command doesn't return a reverse lookup for names in /etc/hosts.  "host 192.168.1.101" produces no output.  

> so I'm not sure why it's failing or how to correct that.

DNS, ideally.  ;-)

But this is just a warning for a reason: it shouldn't matter.  What else does osql report?  

> When I try to connect from ruby-odbc (ODBC.connect('MY_DSN')) with tracing
> enabled, the following errors appear in the trace file:
> 
>                 DIAG [01000] [FreeTDS][SQL Server]Adaptive Server connection
> failed
> 
>                 DIAG [S1000] [FreeTDS][SQL Server]Unable to connect to data
> source

TDSDUMP should report attempting a connection to 192.168.1.101.  

Another trick is to point both TDSDUMP and the ODBC trace to stdout, and redirect to a file.  That lets you see both levels interwoven and sometimes illuminates what's going on.  

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.