[thelist] RS.eof and RS.bof (ASP)

Jay Blanchard jay.blanchard at niicommunications.com
Fri Mar 22 11:27:14 CST 2002


<snip>
hope you guys don't mind me butting in here (i am *so* not an ASP
developer), but isn't the question what to do when there are no records
returned from a query?
...
please don't get mad at me, but does anyone else think this whole thing is
a bit comical?
...
where's the test to see if the recordset is empty?
BOF = beginning of file, EOF = end of file, right?
...
and you are trying to find the right test to see whether something can be
beginning and end at the same time? one or the other but not both? one but
not the other? either or?  not (one and the other)? one and not the other?
</snip>

GUILTY AS CHARGED! I spent very little time analyzing the problem, but I did
say "Do FOO", which also means "whatever FOO is". :)

In ASP when a recordset is returned empty the both BOF and EOF are TRUE.
While it is arguable that you could specify one condition (either BOF or
EOF) and arrive at the same result that is not always the case. So if the
file is NOT BOF or EOF, there is a record to be printed (as in Josh's
example...<td>Name:<td><%=rs("name")%>), but if the recordset is BOF and EOF
it is empty (there is your test). Kinda' the belt and suspenders approach.

Jay

<tip type = "program editors" author = "Jay Blanchard">
Looking for a small step up from notepad on Windows, try the Programmer's
File Editor (it's free, which is a good thing, but no longer supported,
which is a bad thing) but will allow you to have multiple files open with no
limit on file sizes (such as the limitation notepad has), which is
especially convenient when working with lengthy CGI scripts, PHP, PERL, etc.
etc. You can get it from a number of sources and it is a piece of cake to
install.
http://www.google.com/search?hl=en&ie=ISO-8859-1&oe=ISO-8859-1&q="programmer
's+file+editor"
</tip>





More information about the thelist mailing list