The DbEof function tests whether the read pointer is at the end of the recordset or not.
ret = DbEof()
ret, integer. The return value is 1 if the pointer is after the last record of the recordset or if there are no records to read, 0 if not.
'The example uses a data source name called DBTest which contains those records in a table called DATA:
' a,1, 1.23, 02/01/2011
' b,2, 2.34, 03/02/2012
' c,3, 3.45, 04/12/2009
DbConnect("DSN=DBTest") ' connection to ODBC database called DBTest
DbSelect("SELECT * FROM DATA",DYNASET) ' select all records from DATA table.
While not DbEof() ' while there are still records to read
DbGetFieldString("Champ1",a$) ' a$ contains the field named Champ1 (first one in our small example)
MsgBox(a$) ' display the result.
DbMovenext() ' move to next record.