in reply to Using Perl to connect using trusted connection

Include Trusted_Connection=yes in your DSN.
my $DSN = "driver={SQL Server};Server=$server;database=$database;Trust +ed_Connection=yes"; my $dbh = DBI->connect("dbi:ODBC:$DSN") || die "Error: $DBI::errstr";

Replies are listed 'Best First'.
Re^2: Using Perl to connect using trusted connection
by Fuism (Beadle) on Sep 14, 2004 at 16:31 UTC
    Thanks guys for all your help. I solved the problem. Here's the code of my connection:
    $dbprod = DBI->connect('dbi:ODBC:PROD2', $user, $pass, { RaiseError => + 1, odbc_cursortype => 2}); PROD2 is a "System DSN" set up through using the Windows "ODBC Data So +urce Administrator" clicking on the "With windows NT authentication.. +." Instead of "With SQL Server authentication..."
    I it wouldnt work unless I used my NT login and password for $user and $pass. Once again thanks for all your help, your clue made me think more about the problem..... -Fuism
Re^2: Using Perl to connect using trusted connection
by dev2dev (Initiate) on Apr 15, 2010 at 07:22 UTC
    This works PERFECT Thanks a lot!!! I mean this code :) Include Trusted_Connection=yes in your DSN.
    my $DSN = "driver={SQL Server};Server=$server;database=$database;Trust + +ed_Connection=yes"; my $dbh = DBI->connect("dbi:ODBC:$DSN") || die +"Error: $DBI::errstr";