in reply to WIN32::ODBC Returning to few rows...

Set rowcount ? no hehe :)

here's the code.... remember it returns 20 rows

#!perl

use Win32::ODBC;

$DSN = "cheat";
if (!($db = new Win32::ODBC($DSN))){
    print "Error connecting to $DSN\n";
    print "Error: " . Win32::ODBC::Error() . "\n";
    exit;
}


if (!($dbORG = new Win32::ODBC($DSN))){
    print "Error connecting to $DSN\n";
    print "Error: " . Win32::ODBC::Error() . "\n";
    exit;
}

$SqlStatement = "SELECT * FROM tblCheats";
if ($dbORG->Sql($SqlStatement)){
    print "SQL failed.\n";
    print "Error: " . $dbORG->Error() . "\n";
    $$dbORG->Close();
    exit;
}	

while($dbORG->FetchRow()){
    undef %Data2;
    %Data2 = $dbORG->DataHash();
	print "$Data2{'name'}\n";
}

  • Comment on Re: WIN32::ODBC Returning to few rows...

Replies are listed 'Best First'.
Re: Re: WIN32::ODBC Returning to few rows...
by Anonymous Monk on Oct 08, 2002 at 17:54 UTC
    In your code you are only printing rows with $Data2{'name'} in it. If you want to return all rows, I guess you have to change 'name' into a variable pertaining to the column you want to count the row of.
Re: Re: WIN32::ODBC Returning to few rows...
by KrYo (Initiate) on Apr 09, 2001 at 10:59 UTC
    Anyone?