I am writing perl scripts that interface to a Access DB through the Win32:ODBC DBD module. I am using the same connection parameters across all my scripts. They look like the following:
###########################################################
#!c:\Perl\bin\perl.exe -w
use dbi;
use Win32::ODBC;
use CGI ':standard';
print "content-type: text/html \n\n";
#Set up DSN connection settings
$DriverType = "Microsoft Access Driver (*.mdb)";
$DSN = "Win32 ODBC";
$Dir = "c:\\";
$DBase = "po.mdb";
#Intialize PO database temporary DSN
Win32::ODBC::ConfigDSN(ODBC_ADD_DSN, $DriverType,
("DSN=$DSN", "Description=Database Connection", "DBQ=$Dir\\$DBase", "DEFAULTDIR=$Dir", "UID=", "PWD="))
or die "ConfigDSN(): Could not add temporary DSN" . Win32::ODBC::Error();
#Connect to PO DB
$db=new Win32::ODBC($DSN) or die "couldn't open DB: $DSN because ", Win32::ODBC::Error(), "</br>";
$db->Close();
###########################################################
My problem is this: If I call one script from another...I.E if an event occurs I go to another script. The problem is that in the called script Anything passed the ConfigDSN() method doesn't get executed.
Any help is appreciated
###########################################################
#!c:\Perl\bin\perl.exe -w
use dbi;
use Win32::ODBC;
use CGI ':standard';
print "content-type: text/html \n\n";
#Set up DSN connection settings
$DriverType = "Microsoft Access Driver (*.mdb)";
$DSN = "Win32 ODBC";
$Dir = "c:\\";
$DBase = "po.mdb";
#Intialize PO database temporary DSN
Win32::ODBC::ConfigDSN(ODBC_ADD_DSN, $DriverType,
("DSN=$DSN", "Description=Database Connection", "DBQ=$Dir\\$DBase", "DEFAULTDIR=$Dir", "UID=", "PWD="))
or die "ConfigDSN(): Could not add temporary DSN" . Win32::ODBC::Error();
#Connect to PO DB
$db=new Win32::ODBC($DSN) or die "couldn't open DB: $DSN because ", Win32::ODBC::Error(), "</br>";
$db->Close();
###########################################################
My problem is this: If I call one script from another...I.E if an event occurs I go to another script. The problem is that in the called script Anything passed the ConfigDSN() method doesn't get executed.
Any help is appreciated