Skip to Content.
Sympa Menu

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

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Login fails w/iodbc, works with tsql
  • Date: Fri, 2 Jun 2006 20:19:31 -0400

Greg Martin wrote:
>
> 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=
...
> 1: ODBC_Connect = [FreeTDS][SQL Server]Cannot open database requested in
> login '""'. Login fails. (4060) SQLSTATE=

I'm not sure why it's a problem, exactly, but it seems you need to
provided a database name in your connection string.

When you login with tsql, you land in the 'master' database. Sometimes
that happens when your default database is missing or otherwise not
available to you.

When you use iODBC, the server knows you're using ODBC. ISTR a
restriction whereby ODBC connections cannot fail to change to the user's
default database. Instead, you get a 'login failed' error.

>
> 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"

If you want FreeTDS to do charset conversion, you need to use
ODBC-combined. The only place we pick up the client charset is in
freetds.conf. (You're using ROMAN8, which the built-in converter won't
handle and which, as you probably know, differs significantly from ISO
8859-1 in the range [128-255]. But that's not preventing you from logging
in.

Here's the same complaint coming back from the server:

> 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 - |.....|

HTH.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page