ax1...@hotmail.com wrote:
> 
> 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" }

This appears to have nothing to do with XAMPP and Apache so I would forget about
it for now. Is it your intention to run your PC as a Web server at some point?

It looks like you successfully installed the DBI module, but to connect to an
ODBC database you also need the DBD::ODBC module.

When you say you can't run ppm at a command prompt, what is the problem? Can you
start a command prompt window at all? You will have a ppm command only if you
have installed ActiveState Perl: if you are using the XAMPP Perl add-on then you
 will have to make use of CPAN instead. How did you install DBI, as that seems
to have been successful?

Finally, there must be a database called 'Poker' for the DBI connect to work,
but it should be clear if the software is failing for that reason.

Rob


-- 
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