show details of first record

B

Bryan Harrington

I have a list of requests that I'm displaying. The client wants to be able
to display the details of the FIRST request as the page loads.

Right now, as I loop through the recordset, I'm checking the querystring for
"rid", and if rid = "" then I do a response.redirect to the page adding the
rid value to the querystring from the recordset.

I'm thinking this is not very effecient, but I can't figure out anything
better.. anyone have a good solution to show the details of the first item
on the list?

Thanks!
 
R

Ray Costanzo [MVP]

I don't understand what the "rid" has to do with what you're trying to do.
Can you show us what you're doing somehow?

Ray at work
 
B

Bryan Harrington

As I loop through the recordset, I have these lines of code:

......
do until rswl.eof
if request.querystring("rid") = "" then
response.redirect("worklist.asp?rid=" & rswl("reject_id") & "&Page=" &
iCurrentPage )
end if
......
etc..

I need to grab the first item on the list and show it's details, and the
above works, but just doesn't seem effecient to me, but I don't really want
to do a select top 1 (because the sql is pretty big, and pretty dynamic
(based on user login)), and then open the full recordset again.. that
doesn't seem effecient either.
 
R

Ray Costanzo [MVP]

Well, this is inefficient if request.queryting("rid") is empty, since
that'll be evaluated every time, and you'll loop through the recordset for
nothing.

What is rid? Why are you passing a value in a querystring that you aren't
using? Is that an ID number? Is that value not already known and available
elsewhere in your code?

Response.Redirect "worklist.asp?rid=" & rswl("reject_id") & "&page=" &
iCurrentPage

You know it's going to be the first record in the recordset anyway, right?

Ray at work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top