[ back to toc ]

CGI databases

Date: 2002/02/25 14:03

Q:
I have a very simple problem which is making my life a misery. I am trying
to show the values held in 1 column in a microsoft Access database.
I keep getting errors. This is for My masters progject and I know I can
use MySQL, but it would be just a little easier for me to do it with
Access.
Here is the url i am using to get teh database results:
www.canyoudrive.com/test.cgi (refresh the page if you go to MSN.
Here is the script that does not work
#Windows-based Perl/DBI/MS Access example
use DBI;

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

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

#output database results
while (@row=$sth->fetchrow_array)
{ print "@row\n" }
I am in real need of urgent help, i will even pay for the help. Thanks.
Let me know if you need the psasword and username to check it out if
willing to help. I will even pay

A:
I am not an expert in Access, but as far as I know Access ODBC SQL
interface does NOT implement the full SQL. As I experienced when I tested
ScriptBasic ODBC module Access does not allow

SELECT COLUMNS FROM ...

format only

SELECT * FROM ...

can be used. I do recommend however that you install MySQL on Windows NT
or a nearby Linux and use MySQL for the test if you have experience with
that. If you have experience with some other DB install that one (assumed
no licence problems though).

Regards,
Peter

[ back to toc ]