The DbBof function tests whether the read pointer is at the beginning of the recordset or not.
ret = DbBof()
ret, integer. The return value is 1 if the pointer is before the first record of the recordset, 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.
If DbBof()=1 then ' no record in the selection.
stop ' then stop the script.
else ' if records are in selection, continue.
msgbox("pointer at the beginning")