[thelist] ASP, SQL, Recordsets, Best Practices

Scott Dexter sgd at ti3.com
Thu Mar 1 15:27:48 CST 2001


> > if oRS.BOF and oRS.EOF then
> > sizefromdb=Empty
> 
> What does BOF mean?  and/or how does it differ from EOF?  
> Should they both
> be used *always* together?

BOF = Beginning Of File (EOF = End Of File)

ADO Recordsets will set both to true if the recordset is empty. Yes, should
be used together to test for an empty Recordset. (There are situations
depending on the locktype and cursor used that will set BOF or EOF when
there is actual data; testing both like this is the only guaranteed way
regardless of the type of recordset you've opened)

> > sizefromtb=oRS(0) ' the first column, this is faster than by name
> 
> Thanks for the tip, I presume that field names start at (0), 
> instead of 1.
> Anything special depending on whether the field is an auto-incremented
> field?

Yes, all arrays, collections, etc in VB(Script) are zero-indexed. No, it has
nothing to do with the actual value in the column....

sgd




More information about the thelist mailing list