Skip to Content.
Sympa Menu

freetds - Re: [freetds] Issue connecting to SQL Server from LinuxHostwithnewerversions of FreeTDS...

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: christos AT zoulas.com (Christos Zoulas)
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Issue connecting to SQL Server from LinuxHostwithnewerversions of FreeTDS...
  • Date: Tue, 28 Nov 2006 13:49:05 -0500

On Nov 28, 12:58pm, Glenn AT addsys.com ("Glenn, Chris") wrote:
-- Subject: Re: [freetds] Issue connecting to SQL Server from LinuxHostwithne

| PS.
| ------------------------------------------------------------------
| This is what my code in the net.c file looks like;
| ------------------------------------------------------------------
| ...
| (void)memset(&sin, 0, sizeof(sin)); /* CG - ADD */
| FD_ZERO(&fds);
|
| size_t msg_len; /* CG - ADD */
| int port = 0; /* CG - ADD */
|
| (void)memset(&sin, 0, sizeof(sin)); /* CG - ADD */
|
| sin.sin_addr.s_addr = inet_addr(ip_addr);
| if (sin.sin_addr.s_addr == INADDR_NONE) {
| ...
| ------------------------------------------------------------------
| And here is the log output;
| ------------------------------------------------------------------
|
| util.c:292:Starting log file for FreeTDS 0.65.dev.20061128
| on 2006-11-28 11:59:30 with debug flags 0x4fff.
| iconv.c:195:names for ISO-8859-1: ISO-8859-1
| iconv.c:195:names for UTF-8: UTF-8
| iconv.c:195:names for UCS-2LE: UCS-2LE
| iconv.c:195:names for UCS-2BE: UCS-2BE
| iconv.c:361:iconv to convert client-side data to the "ANSI_X3.4-1968"
| character
| set
| iconv.c:514:tds_iconv_info_init: converting "US-ASCII"->"UCS-2LE"
| iconv.c:514:tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
| net.c:190:Connecting to 10.3.2.40 port 0 (TDS version 7.0)
| net.c:245:error: connect(2) returned 0x73, "Operation now in progress"
| net.c:247:Contents of sockaddr_in
| 0000 02 00 00 00 0a 03 02 28-00 00 00 00 00 00 00 00 |.......( ........|
|
| net.c:248: sockaddr_in:
| sin_family = 2
| sin_port = 0
| sin_addr.s_addr = 2802030a
| (param ip_addr) = '10.3.2.40'
| net.c:278:tds_open_socket: 10.3.2.40:0: Invalid argument
| util.c:120:Changing query state from IDLE to DEAD
| token.c:2221:tds_client_msg: #20003: "SQL Server connection timed out.".
| Connec
| tion state is now 4.
| mem.c:565:tds_free_all_results()
|
|
|

Port 0 is wrong. In the global section of freetds.conf add:

[global]
# TDS protocol version, MSSQL 2K+
tds version = 8.0
# MSSQL server port
port = 1433

I do this because all I have here is SQL2K.

christos




Archive powered by MHonArc 2.6.24.

Top of Page