Perl CGI script using Win::ODBC module - failed login on

byoukstetter_at_hotmail.com
Date: 12/27/04


Date: 27 Dec 2004 14:28:42 -0800

Ok I have an issue with a CGI script that I have written in Perl using
the Win::ODBC module for db access. I have a System DSN that I have
setup on the server and I want the script to use that ODBC DSN for
security reasons. The bit something like:

$DSN = "vrs";
if (!($db = new Win32::ODBC($DSN))){
print "Content-type: text/html\n\n";
print "Error connecting to $DSN\n";
print "Error: " . Win32::ODBC::Error() . "\n";
exit;
}
.
.
.

>>From all the examples I've seen, this work. However, when the script
is run I always get an error like: "the user '(null)' is not
associated with a trusted SQL server connection".

If I change the script to:
$DSN = "vrs";
if (!($db = new Win32::ODBC("dsn=vrs; uid=xx; pwd=blah;"))){
print "Content-type: text/html\n\n";
print "Error connecting to $DSN\n";
print "Error: " . Win32::ODBC::Error() . "\n";
exit;
}

The new Win32::ODBC object is created with out a problem, but I want to
encapsulate the login credentials into the DSN.

I am using IIS (v 6.0 and 5.1). At first I thought this was a system
resource access issue with the user account that IIS uses for this web
site, but after giving this user full access, Im still at a loss. Can
anyone shed some light on my delema? Thanks in advance.

Brandon



Relevant Pages

  • Re: [OT] Perl CGI script using Win::ODBC module - failed login on
    ... > Ok I have an issue with a CGI script that I have written in Perl using ... > associated with a trusted SQL server connection". ... username and password for the DSN properly in the ODBC manager (i.e., ... It definitely doesn't sound like a Perl problem, ...
    (comp.lang.perl.misc)
  • Re: PEAR newbie trying to user PEAR DB and falling at the first hurdle
    ... I use Pear DB too, ... Then check your connection string if that ... $dsn = array( ... a simple connection like so the script just seems to stop but no error ...
    (comp.lang.php)
  • Re: VB Scripting and XP Embedded
    ... Before going to the XPe troubleshooting route it may make sense to check out what's in your ... > script that contains a simple con.open connection string. ... > creating a DSN entry to the database, ... That may also mean you've got problems with OLE DB provider (SQL Server). ...
    (microsoft.public.windowsxp.embedded)
  • Re: Need help with Perl and MySQL database data load
    ... > I modified my script to declare ... > my $dsn ... > When I ran the script I got the message: ... Epur Si Muove (Gallileo Gallilei) ...
    (comp.lang.perl.misc)
  • Re: Rights on computer objects through AD
    ... How do I a run this script against Active Directory? ... ReadLineTextFile = InputFile.ReadLine ... OutputFile.Writeline "Error connecting to WMI on " & ...
    (microsoft.public.win2000.active_directory)

Loading