Hi,

I just installed XAMPP after having no luck figuring out how to
configure Apache (yes, I am very much a rookie). I installed it, and
after playing around for a while I was able to get my first Perl
script to work (hello world).

Step 1 accomplished. Whooo hoooo!

Step two is to get my Perl script to successfully pull data from my
Microsot Access DB and display it on the page. When trying to do this,
it seems I'm missing something called DBI. I researched some blogs on
the internet and tried installing this, but it still doesn't seem to
be working. From my understanding I should be able to open a DOS
prompt and type "ppm". I can't do this either.

When I try to open my program in a browser I first get a popup error
entitlted, "apache.exe - Unable to Locate compnent" The description
is, " This application has failed to start because perl58.dll was not
found. Re-installing the application may fix this problem.

I then get a server error, "Error message:
install_driver(ODBC) failed: Can't load 'C:/xampp/perl/site/lib//auto/
DBD/ODBC/O... for module DBD::ODBC: load_file:The specified module
could not be found at C:/xampp/perl/lib/DynaLoader.pm line 203. at
(eval 49) line 3 Compilation failed in require at (eval 49) line 3.
Perhaps a required shared library or dll isn't installed where
expected at C:/xampp/cgi-bin/testdb.pl line 7 "

Anyone have any ideas on what I am doing incorrectly? Here is my code
(keep in mind I have no idea what it's doing for the most part and got
it from an online tutorial):

#!C:/xampp/perl/bin/perl.exe

#Windows-based Perl/DBI/MS Access example
use DBI;

#open connection to Access database
$dbh = DBI->connect('dbi:ODBC:Poker');


#construct SQL statement
$sqlstatement="SELECT FirstName,LastName FROM PokerTable";

#prepare and execute SQL statement
$sth = $dbh->prepare($sqlstatement);
$sth->execute ||
die "Could not execute SQL statement, maybe invalid?";

@row=$sth->fetchrow_array;

($FirstName,$LastName)=$sth->fetchrow_...

#output database results
while (@row=$sth->fetchrow_array)
{ print "@row\n" }

Thanks,

Corey


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to