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

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 last record in a recordset
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 29 October 2001 :  16:44:32  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
How would I find out if the current record is the last in a recordset?? I'm using do until rs.eof

---------------
Da_Stimulator has spoken

Deleted
deleted

4116 Posts

Posted - 29 October 2001 :  18:42:57  Show Profile
If I need this, I get the number of records and use a counter... May not be the only way...

Think Pink
Test Site not ready yet | DL Post v40b02 Files
Go to Top of Page

Hopper
Junior Member

192 Posts

Posted - 29 October 2001 :  18:58:29  Show Profile  Send Hopper an ICQ Message
Perhaps (if rs.absoluteposition = rs.recordcount then)

but I usually use (IF rs.eof then)

it really depends on what you're trying to do.

Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 29 October 2001 :  21:33:15  Show Profile
One way is to set a variable to the record Identifier at each successful iteration through your recordset. Then when you fall out of the loop you have the last record identified in your variable.

For example,
[code]
..
myName = ""
rs.movefirst
do while not rs.eof
'do stuff to the record
myName = rs("name")
rs.movenext
loop
..
response.write "The last record is " & myName
..



======
Doug G
======
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 29 October 2001 :  21:35:43  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
well the reason I was asking was because I put this for each loop


tmpformfields = tmpformfields & siteID & ","


And for the last one I did not need the comma, but I solved that by using the following


tmpfieldlength = len(tmpformfields)
tmpfieldlength = tmpfieldlength - 1
tmpformfields = left(tmpformfields, tmpfieldlength)


Out side of the loop of course :)

---------------
Da_Stimulator has spoken
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.37 seconds. Powered By: Snitz Forums 2000 Version 3.4.07