I am trying to write a cgi script that goes to oracle to get some
information.  I am using WinNT with active state PERL.  I have the O'Reilly
Perl resource kit that shows examples on how to connect to databases.  One
example makes use of the WinNT::ODBC module.
It usese Tk as the gui.  When I use this example and point it to the oracle
database it works, However when I try to convert it to a cgi script and use
the module I get errors.
The error reads like this-Can't locate loadable object for module DBI in
@INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at
C:/Perl/site/lib/DBI.pm line 182
Here is what my code looks like
#!/usr/local/bin/perl
#-----------------------------------
if ($ENV{'SERVER_NAME'} eq '10.255.200.88' || $ENV{'SERVER_NAME'} eq
'isg000011sas009' || $ENV{'SERVER_NAME'} eq 'rochade') {
   require "d:/inetpub/wwwroot/roaccess/cgi-bin/RoInc.pl" ;
}
else {
   require "c:/inetpub/wwwroot/roaccess/cgi-bin/RoInc.pl" ;
}
use strict;
use Win32::ODBC 

my $dsn = "Oracle";
my $user = "hade";
my $passwd = "97";

#require "common.pl" ;
require "cgi-lib.pl" ;

init_dbase();

show_page() ;
sub show_page(){

init_variables() ;
ReadParse() ;
set_standard_variables() ;

write_http_header() ;

print <<HTMLEOF
<HTML>
<HEAD>
<TITLE>Rochade Repository</TITLE>
<META NAME="description" CONTENT="Rochade Skeleton Page">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="black" topmargin="0px" leftmargin="0px"
marginwidth="0px" marginheight="0px">
</body>
</html>
HTMLEOF
;
} #end sub show_page

sub init_dbase {
    print "Connecting to $dsn\n";
    my $connect_string = $dsn;
    if( $user && $passwd ) {
        $connect_string = "DSN=$dsn;UID=$user;PWD=$passwd";
    }

    $dbh = Win32::ODBC->new($connect_string) or
            die Win32::ODBC::DumpError;
}
Can anyone help me or point me in a direction?  Is it a Perl Instalation
Problem or a Perl Path problem?  I am really new at this and totally lost!



Reply via email to