[thelist] Check for empty record set?

Koutoulas, Pete PKOUTOUL at Fayette.k12.ky.us
Thu Jun 19 08:59:53 CDT 2003


On Thursday, June 19, 2003 9:42 AM, Stephen Caudill wrote:

> I noted that it seems to be the consensus to specify:
>  if not (rs.eof and rs.bof) then
> 
> rather than just
>  if not rs.eof
> 
> What is the advantage, practically, of one over the other (other than
> specificity)? 

BOF is true if the current record is before the first record. EOF is true if
the current record is past the last record. 

If you just returned a record set and EOF is true, then you know no records
were returned, assuming that your record set starts at the first record,
which is true for most data providers in most situations. However, in those
cases were you cannot depend on starting at the first record, then there is
some ambiguity in using a test for EOF alone (or BOF alone). 

Since EOF and BOF can only be both true if no records were returned, that is
the safest and most universal test for an empty record set.

___________________________________
Pete Koutoulas, Website Manager
Fayette County Public Schools
701 E. Main Street
Lexington, KY 40502
Voice (859) 381-4138
Fax (859) 381-4763
webmaster at fcps.net
www.fcps.net

 

This student or staff email originated from Fayette County Public Schools in
Lexington, KY. 
Please report instances of abuse or inappropriate content to
postmaster at fayette.k12.ky.us 



More information about the thelist mailing list