Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: perl ODBC connect - runs from command line, not via web/cgi |
|
Author |
|
jblank
Joined: 13 Jul 2009 Posts: 1
|
Posted: Mon 13 Jul '09 23:58 Post subject: perl ODBC connect - runs from command line, not via web/cgi |
|
|
Hi There,
new to this - i'm trying to test a connection to a database using a perl script run through the cgi-bin
script work fine from command line - no go when trying it through my browser though. All other perl scripts i've been testing work ok - seems to be something with the ODBC
The perl script is:
Code: |
#!perl.exe
use Win32::ODBC;
print "Content-type: text/plain; charset=iso-8859-1\n\n";
my $db = new Win32::ODBC("tm");
my $DSN = "tm";
if (!($db)) {
print "Error connecting to $DSN\n";
print "Error: " . Win32::ODBC::DumpError() . "\n";
exit;
}
else {
print "Connection to $DSN successful\n";
exit;
}
$db->Close();
|
nothing reported in the apache log files
and this is the output of the script when run from the web browser:
Code: |
Error connecting to tm
---------- Error Report: ----------
Errors for the package:
Connection Number:
Error number: 911
Error message: ""
-----------------------------------
Error: 1
|
i guess technically the script is working - i just don't seem to be able to connect to the database via the web browser
using: winXP, latest apache, latest perl, downloaded and configured mod_perl, database is set up as system DSN via ODBC, checked all permissions etc
might be something in the httpd.conf file i'm missing?? any suggestions
my perl script is a bit clunky but thought it should do the trick - or does anyone see any probs here?
thanks and regards,
jon[/code] |
|
Back to top |
|
|
|
|
|
|