Skip to Content.
Sympa Menu

freetds - [freetds] Login fails w/iodbc, works with tsql

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Greg Martin" <Greg.Martin AT SPARROW.ORG>
  • To: <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Login fails w/iodbc, works with tsql
  • Date: Fri, 02 Jun 2006 17:32:27 -0400

I'm building towards using the Perl DBI to connect to MSSql servers for
availability testing with BigBrother. After much frustration, I'm starting
from the bottom up, getting each level working in turn.

I'm running hpux 11.11 on the client, to a windows box with Microsoft SQL
Server 2000.

It looks to me that the characterset conversion is causing a problem with
the userid not being recognized when iobcd kicks off freetsd. Dunno....
Any thoughts welcome.

Greg Martin/Sparrow Health System

At this point, tsql works fine:


#tsql -S 66375-is -U greg -P martin

results in

locale is "C C C C C C"
locale charset is "roman8"
1>

logfile:

17:09:42 Starting log file for FreeTDS 0.63
on 2006-06-02 17:09:42 with debug level 99.
17:09:42 names for ISO-8859-1: ISO-8859-1
17:09:42 names for UTF-8: UTF-8
17:09:42 names for UCS-2LE: UCS-2LE
17:09:42 names for UCS-2BE: UCS-2BE
17:09:42 iconv to convert client-side data to the "roman8" character set
17:09:42 tds_iconv_info_init: converting "ROMAN8"->"UCS-2LE"
17:09:42 tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
17:09:42 Connecting to 10.55.2.106 port 1433, TDS 8.0.
17:09:42 tds_put_string converting 5 bytes of "radar"
17:09:42 tds_put_string wrote 10 bytes
17:09:42 tds_put_string converting 4 bytes of "greg"
17:09:42 tds_put_string wrote 8 bytes
17:09:42 tds_put_string converting 4 bytes of "TSQL"
17:09:42 tds_put_string wrote 8 bytes
17:09:42 tds_put_string converting 8 bytes of "66375-is"
17:09:42 tds_put_string wrote 16 bytes
17:09:42 tds_put_string converting 11 bytes of "TDS-Library"
17:09:42 tds_put_string wrote 22 bytes
17:09:42 tds_put_string converting 10 bytes of "us_english"
17:09:42 tds_put_string wrote 20 bytes
17:09:42 tds_put_string wrote 0 bytes
17:09:42 tds_process_login_tokens()
17:09:42 Received header
0000 04 01 01 79 00 36 01 00- |...y.6..|

17:09:42 Received packet
0000 e3 1b 00 01 06 6d 00 61-00 73 00 74 00 65 00 72 |.....m.a .s.t.e.r|
0010 00 06 6d 00 61 00 73 00-74 00 65 00 72 00 ab 66 |..m.a.s. t.e.r..f|
0020 00 45 16 00 00 02 00 25-00 43 00 68 00 61 00 6e |.E.....% .C.h.a.n|
0030 00 67 00 65 00 64 00 20-00 64 00 61 00 74 00 61 |.g.e.d. .d.a.t.a|
0040 00 62 00 61 00 73 00 65-00 20 00 63 00 6f 00 6e |.b.a.s.e . .c.o.n|
0050 00 74 00 65 00 78 00 74-00 20 00 74 00 6f 00 20 |.t.e.x.t . .t.o. |
0060 00 27 00 6d 00 61 00 73-00 74 00 65 00 72 00 27 |.'.m.a.s .t.e.r.'|
0070 00 2e 00 08 36 00 36 00-33 00 37 00 35 00 2d 00 |....6.6. 3.7.5.-.|
0080 49 00 53 00 00 00 00 e3-08 00 07 05 09 04 d0 00 |I.S..... ........|
0090 34 00 e3 17 00 02 0a 75-00 73 00 5f 00 65 00 6e |4......u .s._.e.n|
00a0 00 67 00 6c 00 69 00 73-00 68 00 00 ab 6a 00 47 |.g.l.i.s .h...j.G|
00b0 16 00 00 01 00 27 00 43-00 68 00 61 00 6e 00 67 |.....'.C .h.a.n.g|
00c0 00 65 00 64 00 20 00 6c-00 61 00 6e 00 67 00 75 |.e.d. .l .a.n.g.u|
00d0 00 61 00 67 00 65 00 20-00 73 00 65 00 74 00 74 |.a.g.e. .s.e.t.t|
00e0 00 69 00 6e 00 67 00 20-00 74 00 6f 00 20 00 75 |.i.n.g. .t.o. .u|
00f0 00 73 00 5f 00 65 00 6e-00 67 00 6c 00 69 00 73 |.s._.e.n .g.l.i.s|
0100 00 68 00 2e 00 08 36 00-36 00 33 00 37 00 35 00 |.h....6. 6.3.7.5.|
0110 2d 00 49 00 53 00 00 00-00 ad 36 00 01 71 00 00 |-.I.S... ..6..q..|
0120 01 16 4d 00 69 00 63 00-72 00 6f 00 73 00 6f 00 |..M.i.c. r.o.s.o.|
0130 66 00 74 00 20 00 53 00-51 00 4c 00 20 00 53 00 |f.t. .S. Q.L. .S.|
0140 65 00 72 00 76 00 65 00-72 00 00 00 00 00 08 00 |e.r.v.e. r.......|
0150 07 f7 e3 13 00 04 04 34-00 30 00 39 00 36 00 04 |.......4 .0.9.6..|
0160 34 00 30 00 39 00 36 00-fd 00 00 00 00 00 00 00 |4.0.9.6. ........|
0170 00 - |.|


17:09:42 looking for login token, got e3(ENVCHANGE)
17:09:42 tds_process_default_tokens() marker is e3(ENVCHANGE)
17:09:42 tds_get_string: reading 12 from wire to give 6 to client.
17:09:42 tds_get_string: reading 12 from wire to give 6 to client.
17:09:42 looking for login token, got ab(INFO)
17:09:42 tds_process_default_tokens() marker is ab(INFO)
17:09:42 tds_get_string: reading 74 from wire to give 37 to client.
17:09:42 tds_get_string: reading 16 from wire to give 8 to client.
17:09:42 looking for login token, got e3(ENVCHANGE)
17:09:42 tds_process_default_tokens() marker is e3(ENVCHANGE)
17:09:42 tds_iconv_info_init: converting "ROMAN8"->"CP1252"
17:09:42 looking for login token, got e3(ENVCHANGE)
17:09:42 tds_process_default_tokens() marker is e3(ENVCHANGE)
17:09:42 tds_get_string: reading 20 from wire to give 10 to client.
17:09:42 looking for login token, got ab(INFO)
17:09:42 tds_process_default_tokens() marker is ab(INFO)
17:09:42 tds_get_string: reading 78 from wire to give 39 to client.
17:09:42 tds_get_string: reading 16 from wire to give 8 to client.
17:09:42 looking for login token, got ad(LOGINACK)
17:09:42 tds_get_string: reading 44 from wire to give 22 to client.
17:09:42 looking for login token, got e3(ENVCHANGE)
17:09:42 tds_process_default_tokens() marker is e3(ENVCHANGE)
17:09:42 tds_get_string: reading 8 from wire to give 4 to client.
17:09:42 tds_get_string: reading 8 from wire to give 4 to client.
17:09:42 increasing block size from 4096 to 4096
17:09:42 looking for login token, got fd(DONE)
17:09:42 tds_process_default_tokens() marker is fd(DONE)
17:09:42 tds_process_end: more_results = 0
was_cancelled = 0
error = 0
done_count_valid = 0
17:09:42 tds_process_end() state set to TDS_IDLE
17:09:42 leaving tds_process_login_tokens() returning 1
17:09:42 tds_free_all_results()
17:09:42 tds_put_string converting 19 bytes of "set textsize 64512 "
17:09:42 tds_put_string wrote 38 bytes
17:09:42 Sending packet
0000 01 01 00 2e 00 00 01 00-73 00 65 00 74 00 20 00 |........ s.e.t. .|
0010 74 00 65 00 78 00 74 00-73 00 69 00 7a 00 65 00 |t.e.x.t. s.i.z.e.|
0020 20 00 36 00 34 00 35 00-31 00 32 00 20 00 | .6.4.5. 1.2. .|

17:09:42 Received header
0000 04 01 00 11 00 36 01 00- |.....6..|

17:09:42 Received packet
0000 fd 00 00 be 00 00 00 00-00 |........ .|

17:09:42 processing result tokens. marker is fd(DONE)
17:09:42 tds_process_end: more_results = 0
was_cancelled = 0
error = 0
done_count_valid = 0
17:09:42 tds_process_end() state set to TDS_IDLE
17:09:42 tds_process_result_tokens() state is COMPLETED
17:09:44 tds_free_all_results()
freetds.log: END




However, using the iODBC drivermanager test program, fails:

#iodbctest "DSN=66375-is;UID=greg;PWD=martin"
iODBC Demonstration program
This program shows an interactive SQL processor
Driver Manager: 03.52.0406.0126
1: SQLDriverConnect = [FreeTDS][SQL Server]Cannot open database requested in
login '""'. Login fails. (4060) SQLSTATE=
2: SQLDriverConnect = [FreeTDS][SQL Server]Login failed for user 'greg'.
(18456) SQLSTATE=
3: SQLDriverConnect = [FreeTDS][SQL Server]Login incorrect. (20014)
SQLSTATE=28000
4: SQLDriverConnect = [FreeTDS][SQL Server]Unable to connect to data source
(0) SQLSTATE=08001
1: ODBC_Connect = [FreeTDS][SQL Server]Cannot open database requested in
login '""'. Login fails. (4060) SQLSTATE=
2: ODBC_Connect = [FreeTDS][SQL Server]Login failed for user 'greg'. (18456)
SQLSTATE=
3: ODBC_Connect = [FreeTDS][SQL Server]Login incorrect. (20014) SQLSTATE=28000
4: ODBC_Connect = [FreeTDS][SQL Server]Unable to connect to data source (0)
SQLSTATE=08001

here's the log file:


17:06:26 Starting log file for FreeTDS 0.63
on 2006-06-02 17:06:26 with debug level 99.
17:06:26 names for ISO-8859-1: ISO-8859-1
17:06:26 names for UTF-8: UTF-8
17:06:26 names for UCS-2LE: UCS-2LE
17:06:26 names for UCS-2BE: UCS-2BE
17:06:26 iconv to convert client-side data to the "ISO-8859-1" character set
17:06:26 tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
17:06:26 tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
17:06:26 Connecting to 10.55.2.106 port 1433, TDS 8.0.
17:06:26 tds_put_string converting 5 bytes of "radar"
17:06:26 tds_put_string wrote 10 bytes
17:06:26 tds_put_string converting 4 bytes of "greg"
17:06:26 tds_put_string wrote 8 bytes
17:06:26 tds_put_string wrote 0 bytes
17:06:26 tds_put_string converting 8 bytes of "66375-is"
17:06:26 tds_put_string wrote 16 bytes
17:06:26 tds_put_string wrote 0 bytes
17:06:26 tds_put_string converting 10 bytes of "us_english"
17:06:26 tds_put_string wrote 20 bytes
17:06:26 tds_put_string converting 2 bytes of """"
17:06:26 tds_put_string wrote 4 bytes
17:06:26 tds_process_login_tokens()
17:06:26 Received header
0000 04 01 00 ed 00 00 01 00- |........|

17:06:26 Received packet
0000 aa 90 00 dc 0f 00 00 01-0b 3a 00 43 00 61 00 6e |........ .:.C.a.n|
0010 00 6e 00 6f 00 74 00 20-00 6f 00 70 00 65 00 6e |.n.o.t. .o.p.e.n|
0020 00 20 00 64 00 61 00 74-00 61 00 62 00 61 00 73 |. .d.a.t .a.b.a.s|
0030 00 65 00 20 00 72 00 65-00 71 00 75 00 65 00 73 |.e. .r.e .q.u.e.s|
0040 00 74 00 65 00 64 00 20-00 69 00 6e 00 20 00 6c |.t.e.d. .i.n. .l|
0050 00 6f 00 67 00 69 00 6e-00 20 00 27 00 22 00 22 |.o.g.i.n . .'."."|
0060 00 27 00 2e 00 20 00 4c-00 6f 00 67 00 69 00 6e |.'... .L .o.g.i.n|
0070 00 20 00 66 00 61 00 69-00 6c 00 73 00 2e 00 08 |. .f.a.i .l.s....|
0080 36 00 36 00 33 00 37 00-35 00 2d 00 49 00 53 00 |6.6.3.7. 5.-.I.S.|
0090 00 00 00 aa 46 00 18 48-00 00 01 0e 1d 00 4c 00 |....F..H ......L.|
00a0 6f 00 67 00 69 00 6e 00-20 00 66 00 61 00 69 00 |o.g.i.n. .f.a.i.|
00b0 6c 00 65 00 64 00 20 00-66 00 6f 00 72 00 20 00 |l.e.d. . f.o.r. .|
00c0 75 00 73 00 65 00 72 00-20 00 27 00 67 00 72 00 |u.s.e.r. .'.g.r.|
00d0 65 00 67 00 27 00 2e 00-00 00 00 00 fd 02 00 00 |e.g.'... ........|
00e0 00 00 00 00 00 - |.....|

17:06:26 looking for login token, got aa(ERROR)
17:06:26 tds_process_default_tokens() marker is aa(ERROR)
17:06:26 tds_get_string: reading 116 from wire to give 58 to client.
17:06:26 tds_get_string: reading 16 from wire to give 8 to client.
17:06:26 looking for login token, got aa(ERROR)
17:06:26 tds_process_default_tokens() marker is aa(ERROR)
17:06:26 tds_get_string: reading 58 from wire to give 29 to client.
17:06:26 looking for login token, got fd(DONE)
17:06:26 tds_process_default_tokens() marker is fd(DONE)
17:06:26 tds_process_end: more_results = 0
was_cancelled = 0
error = 1
done_count_valid = 0
17:06:26 tds_process_end() state set to TDS_IDLE
17:06:26 leaving tds_process_login_tokens() returning 0
17:06:26 tds_client_msg: #20014: "Login incorrect.". Connection state is now
2.

17:06:26 tds_free_all_results()
17:06:26 SQLFreeHandle(2, 0x40015a18)
17:06:26 SQLFreeHandle(1, 0x40015978)
freetds.log: END

freetds.conf:

# A typical Microsoft SQL Server 2000 configuration
;[MyServer2k]
; host = ntmachine.domain.com
; port = 1433
; tds version = 8.0

[SnoopDog]
host = 66375-is.shs.org
port = 1433
tds version = 8.0

[66375-is]
host = 66375-is.shs.org
port = 1433
tds version = 8.0






Archive powered by MHonArc 2.6.24.

Top of Page