in reply to Can anyone help me -- this code executes but does not get data from MS Access database on web host

If you do it the way you are doing it you may need to create server variables out of the $rs. Just like how you created the connection you need to make $rs into a record set. My guess (from using asp) is:
my $rs = CreateObject OLE "ADODB.Recordset" or die "can not create rec +ordset"; $rs->open($sqlstatement, $dbh, 3, 3);
so you code would look like :
use strict; use OLE; my $dbh; $dbh = CreateObject OLE "ADODB.Connection" or die "Can't create connec +tion to DataBase: $!" unless $dbh; $dbh->Open("Driver={Microsoft Access Driver (*.mdb)};DBQ=\_private\db1 +.mdb"); my $rs = CreateObject OLE "ADODB.Recordset" or die "can not create rec +ordset"; my $sqlstatement="SELECT email,password FROM surya"; $rs->open($sqlstatement, $dbh, 3, 3); while (!$rs->EOF()) { print $rs->Fields('email')->Value . " " . $rs->Fields('password')- +>Value . "\n"; $rs->MoveNext; }


--BigJoe

Learn patience, you must.
Young PerlMonk, craves Not these things.
Use the source Luke.
  • Comment on Re: Can anyone help me -- this code executes but does not get data from MS Access database on web host
  • Select or Download Code