Click to See Complete Forum and Search --> : Check if recordset is last


joyceqian
09-08-2008, 04:13 AM
i am using sql server 2000 and vbscript. i want to check if my recordset is the last record set so that i can do something with it thats different from the rest of the record set.

is there any code to use? unlike using .jsp where i can use isLast(), there seems to be no function for recordset.

zingmatter
09-08-2008, 05:43 PM
rsRecordset.MoveLast would at least take you to the last item.

Other with, some logic based around if rsRecordset.EOF then ...

Terrorke
09-09-2008, 06:02 AM
Movelast indeed takes you to the last record in the recordset.
But I think you want to check if the current record is the last one in the recordset while looping thru it.

This can be done, I think, by checking it in an if statement.

Something like

if rs.eof then
...
end if