T
Thomas Rawley
I am on a Windows machine and I need to acess some data in a MS Access
database so I can display it on a website. Both the perl script and the
database file are currently in the same directory on the same computer
(Windows XP). I have ActivePerl installed and downloaded and installed both
the DBI and DBD::ODBC modules using ppm.
When I try to run the script, I get and error saying the data source name
was not found and no default driver specified. The code is below. Any help
on this would be wonderful. Thanks in advance.
use DBI;
$DSN = 'driver=Mircosoft Access Driver (*.mdb);dbq=MyEasinetEvents.mdb';
$dbh = DBI->connect("dbi:ODBC:$DSN",'','');
$sth = $dbh->prepare("SELECT * FROM Events");
$sth->execute();
print "Content-type:text/html\n\n";
print "<html><body><h1>Fingerprint Scanner Records</h1>";
print "<table>\n";
print
while( @row = $sth->fetchrow_array )
{
print "<tr>";
foreach $field (@row)
{
print "<td>$field</td>";
}
print "</tr>";
}
print "</table>\n";
print "</body></html>";
$sth->finish;
$dbh->disconnect;
Thomas
database so I can display it on a website. Both the perl script and the
database file are currently in the same directory on the same computer
(Windows XP). I have ActivePerl installed and downloaded and installed both
the DBI and DBD::ODBC modules using ppm.
When I try to run the script, I get and error saying the data source name
was not found and no default driver specified. The code is below. Any help
on this would be wonderful. Thanks in advance.
use DBI;
$DSN = 'driver=Mircosoft Access Driver (*.mdb);dbq=MyEasinetEvents.mdb';
$dbh = DBI->connect("dbi:ODBC:$DSN",'','');
$sth = $dbh->prepare("SELECT * FROM Events");
$sth->execute();
print "Content-type:text/html\n\n";
print "<html><body><h1>Fingerprint Scanner Records</h1>";
print "<table>\n";
th><th>Archived</th></tr>\n";SubAddr</th><th>UserID</th><th>CardNo</th><th>Details</th><th>LinkedEvent</
while( @row = $sth->fetchrow_array )
{
print "<tr>";
foreach $field (@row)
{
print "<td>$field</td>";
}
print "</tr>";
}
print "</table>\n";
print "</body></html>";
$sth->finish;
$dbh->disconnect;
Thomas