Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

An easy ASP database question...

Status
Not open for further replies.

Eek

Technical User
Feb 4, 2001
34
0
0
CA
Here's something that should be easy to answer.

Here's a loop that will print ALL the 'comments' records.....how can I only print the last record ? And if possible how can I only print the last 2 records ?


Do While not rsGuestbook.EOF
Response.Write (rsGuestbook("Comments"))
Loop
 
oh yeah I forgot.... the above is a Cut & PAste of an ASP that connects to an Access DB to get the COMMENTS record
 
rsguestbook.movelast (last record)
rsguestbook.moveprevious (one before the last)

what you're after might be easier to achieve with getrows, then you can reference any part of the array at any given point so you can shift around all you want in a non-linear form.

ps, there's no movenext in that loop, and without it will cause an infinite loop/timeout/lockup

[thumbsup2]DreX
aKa - Robert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top