Re: [OT] Perl CGI script using Win::ODBC module - failed login on

From: Matt Garrish (matthew.garrish_at_sympatico.ca)
Date: 12/28/04


Date: Mon, 27 Dec 2004 23:55:08 -0500


<byoukstetter@hotmail.com> wrote in message
news:1104186522.138162.41690@f14g2000cwb.googlegroups.com...
> 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 understand you correctly, it sounds like you haven't specified the
username and password for the DSN properly in the ODBC manager (i.e., there
is no default user and password for that DSN). Go to Settings -- Control
Panel -- Admin Tools -- ODBC Settings (or something similar depending on
your version of Windows) and trying testing the connection. If you can't
connect, then go over the settings and see what you've missed. Also, make
sure that you've set it up as a System DSN and not a User DSN.

It definitely doesn't sound like a Perl problem, though. I would personally
recommend you switch to the DBI and DBD::ODBC modules, however, as support
for Win32::ODBC is suspect.

Matt



Relevant Pages

  • Advice for moving linux script to MacPerl
    ... in perl that runs on our Linux web server. ... - I told them to download and install MacPerl, ... script that prints the environment variables. ...
    (comp.lang.perl.misc)
  • Perl / Apache on RH9.0 not working.
    ... The server encountered an internal error and was unable to complete your ... Premature end of script headers: ... This is the first time I"ve used Apache 2.0 so I'm not sure if this is an Apache or a Perl issue. ... Configuration Phase Participation: Create Directory Config, ...
    (RedHat)
  • [Full-Disclosure] PR0V1NG RFP WR0NG
    ... Agree that the presented Perl code has issues, and I agree that it's very ... I've taken a sample perl test script which reads: ... Server: Netscape-Enterprise/4.1 ... I'm a washed out sell out capitalizing on my 10 seconds of fame for writing some crappy advisories and some shitty perl code. ...
    (Full-Disclosure)
  • RE: Perl / Apache on RH9.0 not working.
    ... Perl / Apache on RH9.0 not working. ... The server encountered an internal error and was unable to complete your ... Premature end of script headers: ... Configuration Phase Participation: Create Directory Config, ...
    (RedHat)
  • Perl versus Expect(tcl) : Specific Example
    ... Perl vs Expectquestion again. ... Launch masterbuild.tcl (expect script) from WinNT server. ... Enter Solaris server, perform authentication, set the Solaris ... Enter HPUX server, perform authentication, set the HPUX build ...
    (perl.beginners)

Loading