Re: [OT] Perl CGI script using Win::ODBC module - failed login on
From: Matt Garrish (matthew.garrish_at_sympatico.ca)
Date: 12/28/04
- Next message: Gunnar Hjalmarsson: "Re: Loading Modules with "require""
- Previous message: PerlFAQ Server: "FAQ 7.1: Can I get a BNF/yacc/RE for the Perl language?"
- In reply to: byoukstetter_at_hotmail.com: "Perl CGI script using Win::ODBC module - failed login on"
- Next in thread: brandony: "Re: Perl CGI script using Win::ODBC module - failed login on"
- Reply: brandony: "Re: Perl CGI script using Win::ODBC module - failed login on"
- Reply: brandony: "Re: Perl CGI script using Win::ODBC module - failed login on"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Gunnar Hjalmarsson: "Re: Loading Modules with "require""
- Previous message: PerlFAQ Server: "FAQ 7.1: Can I get a BNF/yacc/RE for the Perl language?"
- In reply to: byoukstetter_at_hotmail.com: "Perl CGI script using Win::ODBC module - failed login on"
- Next in thread: brandony: "Re: Perl CGI script using Win::ODBC module - failed login on"
- Reply: brandony: "Re: Perl CGI script using Win::ODBC module - failed login on"
- Reply: brandony: "Re: Perl CGI script using Win::ODBC module - failed login on"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|