Connecting Tech Pros Worldwide Forums | Help | Site Map

Using Win32::ODBC with Perl

Newbie
 
Join Date: Apr 2006
Posts: 2
#1: Apr 28 '06
Hi i m working on my high school project and trying to connect to MS Access database by using Perl though i 'm able to connect with the databse but was unable to extract data from the table in the database.here i''m sending the coding alongwith the error i'm getting.

Plz help me

-----------------------code-----------------------
#!c:/phpdev/perl/bin/

use Win32::ODBC;
# 'data' is the name of the database i'm using

$db = new Win32::ODBC("data");

if(! $db ) {

print "Error - data database not found! \n";

}
else {
print "Present \n ";
}

@tables = $db->TableList();

printf ("I found these tables: %s \n", join(" ", @tables));

$db->Sql("SELECT * FROM tbl") || die "Can't execute \n";

-----------------------code-finish-----------------------

-----------------------Output--------------------------
Present
I found these tables: tbl
Can't execute
--------------------------------------------------------

here database has table with name tbl which is found.


Sethi
Reply