Error when connecting to database using Win32::ODBC

M

madan

hi all,
i am getting a error when i use Win32::ODBC..Please check it out and
see weather its working on ur systems..i need to connect to database...
#! /usr/bin/perl

use lib '/cgi-bin/lib';
require("CGI.pm");
use CGI::Carp 'fatalsToBrowser';
use CGI;
use Win32::ODBC;
my $cgi = CGI->new;
$dbh= new Win32::ODBC("dsn=test");
print $cgi->header( 'text/html' );
print $cgi->start_html;
print $cgi->startform("get","/cgi-bin/data.cgi");
if(!$dbh)
{
&printFailure;
exit();
}
else
{
&printSucess;
}

sub printFailure {
print "failure in connecting <br>".Win32::ODBC::Error();
}
sub printSucess {
print "Connection Sucessful<br>";
}
print $cgi->endform;
print $cgi->end_html;
############################
The following error is coming only when i use Win32::ODBC module..
when i removed it the program is working fine..I checked the dsn,user
name and password all are right...
the following error is shown on the browser..
##########################################################################
Undefined subroutine &Scalar::Util::blessed called at
W:/usr/lib/overload.pm line 89.
Compilation failed in require at W:/usr/lib/Config.pm line 70.
Compilation failed in require at W:/usr/site/lib/Win32/ODBC.pm line 27.
Compilation failed in require at W:/cgi-bin/dbtest.pl line 7.

BEGIN failed--compilation aborted at W:/cgi-bin/dbtest.pl line 7.
############################################################################
i am new to perl...so i dont have enough stuff to write a good
syntax...
thanks in advance
 
D

David Squire

madan said:
hi all,
i am getting a error when i use Win32::ODBC..Please check it out and
see weather its working on ur systems..i need to connect to database...
#! /usr/bin/perl

missing:

use strict;
use warnings;

# get Perl to help you help yourself before asking here.
require("CGI.pm"); ....
use CGI;

Which of these do you mean (almost certainly the second)? This problem
has already been pointed out to you, as have others still in your code.
Read, understand, and act on advice rather than just reposting your problem.

DS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top