Skip to Content.
Sympa Menu

freetds - RE: [freetds] Receive "Login failed for user '(null)'" Error

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: 'FreeTDS Development Group' <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] Receive "Login failed for user '(null)'" Error
  • Date: Mon, 1 Dec 2003 13:26:26 -0500

> From: Mark Segall [mailto:Mark.Segall AT morganstanley.com]
> Sent: December 1, 2003 12:07 PM
>
> However, when I try to connect under perl (using the same
> conf file), I
> get the "Login failed for user '(null)'. Reason: not associated with a
> trusted SQL Server connection" when I issue my connect.

You're right, that's the telltale message for a failed domain login. Is
there any chance that $app_server is empty, or contains a '\' character? In
that event, FreeTDS would attempt a domain login. I'm not sure the "tds
server/domain login" entries have any effect anymore (they might).

(Memo to file: We should note the type of login in the log when we record
the connection attempt.)

I doubt LD_LIBRARY_PATH is the issue. If you doubt your freetds.conf is
being consulted, the TDSDUMPCONFIG variable should clear that up.

> In the perl routine I have the following statements:
> use lib '/u/appname/freetds/lib';
> use DBI;
> use Sybase::DBlib;
> $libpath=$ENV{LD_LIBRARY_PATH};
>
> $dbh = DBI->connect($app_server, $app_user, $app_passwd) or die
> $DBI::errstr;
> $ dbh->do('use DBName');
>
>
> Any ideas on why tsql works fine but using the DBI connect
> does not?

I don't think that connect() call is right. Are you using DBI or Sybperl?

If DBI, you need "use DBD::Sybase" (and will use FreeTDS's ct-lib), and
would connect with:

$dbh = DBI->connect("dbi:Sybase:server=$app_server", $app_user,
$app_passwd);

If Sybperl, you can use Sybase::DBlib, but your database handle would be
constructed:

$dbh = new Sybase::DBlib $app_user, $app_passwd, $app_server,
'test_app';

Cf. "perldoc DBD::Sybase" and "perldoc Sybase::DBlib" for details. ;-)

Perhaps by bolting things together incorrectly, you managed to pass a null
username to the FreeTDS login function?

--jkl
-----------------------------------------
The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the original
message. Please note that we do not accept account orders and/or instructions
by e-mail, and therefore will not be responsible for carrying out such orders
and/or instructions.






Archive powered by MHonArc 2.6.24.

Top of Page