Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Discussions (General)
 Checking empty recordset should be changed
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

nylonTiger
Starting Member

9 Posts

Posted - 18 April 2003 :  23:20:12  Show Profile  Send nylonTiger a Yahoo! Message
All files (3.4.0.3) use rs.EOF or rs.BOF to check if a recordset is empty.
I think it should be rs.EOF and rs.BOF.
This doesn't cause any effects or bugs though, but...

dayve
Forum Moderator

USA
5820 Posts

Posted - 19 April 2003 :  00:35:58  Show Profile  Visit dayve's Homepage
Why? perhaps explain your reasoning a bit more... I've seen this argument more than once...

quick and dirty from MSDN...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdapro01_7.asp

Go to Top of Page

nylonTiger
Starting Member

9 Posts

Posted - 19 April 2003 :  01:28:39  Show Profile  Send nylonTiger a Yahoo! Message
Because it was said so
quote:
If you open a Recordset object containing no records, the BOF and EOF properties are set to True

If only BOF or EOF is true, the recordset may not be empty.
If you depend on the fact that
quote:
When you open a Recordset object that contains at least one record, the first record is the current record and the BOF and EOF properties are False.
then why don't you just check only rs.EOF (or rs.BOF)?
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 19 April 2003 :  01:33:50  Show Profile
I always use "if rs.bof and rs.eof" as a test, although so far a non-empty recordset will never open with either bof or eof true. However it would be possible (unlikely though) to move the rs pointer and erroneously detect an empty recordset if you don't test for both bof and eof being true simultaneously.


======
Doug G
======
Computer history and help at www.dougscode.com
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 19 April 2003 :  17:17:34  Show Profile  Visit dayve's Homepage
quote:
Originally posted by nylonTiger

Because it was said so
quote:
If you open a Recordset object containing no records, the BOF and EOF properties are set to True

If only BOF or EOF is true, the recordset may not be empty.
If you depend on the fact that
quote:
When you open a Recordset object that contains at least one record, the first record is the current record and the BOF and EOF properties are False.
then why don't you just check only rs.EOF (or rs.BOF)?



all depends on how you're moving through the recordset, especially if you are deleting records... that's why I asked you to explain a bit further.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.2 seconds. Powered By: Snitz Forums 2000 Version 3.4.07