unable to connect to database(MS access)

bhavin12300's Avatar, Join Date: Apr 2007
Light Poster
hi
i am building .pl script to get connect to database which is in MS access in windows
but i am able to fetch data from it .it prints nothign.
here is the code

$db="emaildb";

$dbh=DBI->connect("dbi:ADO:$db",'','');

$sq="select * from emaillists";
$qry=$dbh->prepare($sq);
$qry->execute();
while(@data = $qry->fetchrow_array()){
print @data[1];
}

i have created DSN with this database in windows
wating plzzzzzzzzzz
0
pradeep's Avatar, Join Date: Apr 2005
Team Leader
check whether its connecting or not...

Code: Perl
$dbh=DBI->connect("dbi:ADO:$db",'','') or die("$!");