Problem with revNumberOfRecords
Jan Schenkel
janschenkel at yahoo.com
Sun Feb 13 16:54:00 EST 2005
--- Jérôme Rosat <jrosat at mac.com> wrote:
> Dear all,
>
> I use a stack with a MySQL database. To move through
> the records in a
> record set I use this script:
>
> revMoveToFirstRecord thisCursor
> repeat for revNumberOfRecords(thisCursor) times
> -- bla bla
> revMoveToNextRecord thisCursor
> end repeat
>
> When I use the same stack with a Access 97 database
> and a ODBC
> connection and the same number of records, the
> revNumberOfRecords
> function return -1.
>
> How to resolve this problem ?
>
> Jérôme Rosat
>
Hi Jérôme,
This particular problem has been around forever, and
is appearently a conflict between Access and the revdb
ODBC driver.
Your best solution is to use the 'revdb_iseof()' or
'revCurrentRecordIsLast()' functions to determine the
end of your loop :
--
revMoveToFirstRecord thisCursor
repeat forever
-- bla bla
if revCurrentRecordIsLast() then exit repeat
else revMoveNextRecord thisCursor
end repeat
--
Hope this helped,
Jan Schenkel.
=====
Quartam - Tools for Revolution
<http://www.quartam.com>
=====
"As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld)
__________________________________
Do you Yahoo!?
The all-new My Yahoo! - Get yours free!
http://my.yahoo.com
More information about the use-livecode
mailing list