bypassing /etc/freetds.conf or interfaces file

David Nahman vanyadogue at yahoo.com
Thu Dec 13 22:32:03 EST 2001


Brian,

Thanks for your reply.  I discovered that it works like you said and my
problem lies with inet_ntoa under IRIX.

Inet_ntoa is returning 0.0.0.0 for any valid ip address that is retrieved
by gethostbyname when compiling under IRIX64.  I verified that this works
under irix by compiling a sample program outside of freetds, and it works
as it is supposed to.  Moving that sample code inside of lookup_host and I
still get 0.0.0.0 (I've verified the bytes in hostent->host_addr are
correct).

So, I'm trying to figure out if there is a flag configuration that I need
to pass to configure.  Right now I'm using: --prefix=<mypath> --disable-shared and
--with-tdsver=7.0.  I've tried no --host flag, --host=mips-sgi and
--host=mips-sgi-irix.

Any thoughts that you or others might have would be most appreciated.

Thanks!
--David


> Ok, the non-portable (as in don't expect this to work on OpenClient or 
> MS's stuff), is:
> 
> Compile FreeTDS with the desired version using the --with-tdsver=x.x 
> configure flag.  I'll assume this is for MS SQL, so let's say it's 7.0 for
> arguments sake.
> 
> Now do everything like normal but use the DNS name of the host on which
> the database lives as the server name.  As long as the SQL Server is 
> listening on prot 1433, this will work.
> 
> If you are using Sybase or MS SQL is not on 1433 put in a call like this:
> 
> tds_set_port(con->tds_login, 4000);
> 
> just prior to calling ct_connect() where con is the pointer returned from
> ct_con_alloc() and 4000 is the port number the server is listening at.
> 
> If you also need for some reason to change the TDS protocol version have a
> look at tds_set_version() also in src/tds/login.c and make a similiar call
> to it.
> 
> Changing the port number can also be done at runtime by using the TDSPORT
> environment variable.  Legal values are 4.2, 5.0, and 7.0.
> 
> Brian 
> 



More information about the FreeTDS mailing list