[freetds] Using freetds in Windows

jklowden at schemamania.org jklowden at schemamania.org
Fri Jan 8 17:19:43 EST 2010


On Fri, Jan 08, 2010 at 01:19:01AM -0500, Andrew H. Wakefield wrote:
> Still having problems with freetds 0.82 running under Windows ... here
> is the latest symptom:
> 
> Using tsql, I can connect to the SQL database if I specify the Host and
> port directly. If I specify the Server name, *even though it is finding
> the freetds.conf file and translating to the correct IP address and
> port*, it errors out. Let me make it clear: According to the log file
> generated with TDSDUMPCONFIG, it *IS* finding the freetds.conf file, and
> according to the TDSDUMP log file, it *IS* translating to the right IP
> address and port. But for some reason, it errors out.

The reason isn't terribly clear, is it?  

I committed changes today to make the TDSDUMP log clearer for Win32 failures. tsql doesn't work, but bsqsldb does.  I'll try to fix tsql too.  The updates should appear in the nightly snapshot.  


The primary problem is that Windows sockets only vaguely resemble the standard sockets they're based on.  They don't set errno; they require a call to WSAGetLastError().  That returns a number, sure enough, but not one you can translate with strerror(3) or perror(3) or in fact any Win32 function. I wrote tds_prwsaerror() just for that purpose.  

HTH.

--jkl



More information about the FreeTDS mailing list