Try searching for your answer in the DBI FAQ www.xmlproj.com/cgi/fom.cgi first. Then, if that doesn't help, post the error information, version of perl, version of DBI, version of DBD::ODBC along with the code again.
Regards, Jeff > > Hi > > I am trying database connectivity using DBI/ODBC thru perl in > web > page when i run programme locally(standalone not on any server) > it > works well but when i run it thru server it gives exception > while > connecting to database.I am using apache server.I am new to perl > so can anyone tell whether i need to make environment setting in > apache server cos i guess when i run the perl file thru command > >perl test.pl it gives me reult but when i run it on server > >using > http://localhost/cgi-bin/test.pl it gives error. > > code is simple one > #! c:/perl/bin/perl.exe > print "Content-type: text/html\n\n"; > use CGI; > use DBI; > $dbh = DBI->connect( "dbi:ODBC:perltest") or print("Can't > connect: > "); > print "connected" > $sth = $dbh->prepare("select * from person"); > $sth->execute; > while($name = $sth->fetchrow) > { > print $name,"\n"; > } > $dbh->disconnect; > > > >
