Re-using a record set in a do-while loop

Results 1 to 2 of 2

Thread: Re-using a record set in a do-while loop

  1. #1
    Join Date
    Dec 1969

    Default Re-using a record set in a do-while loop

    I am selecting a recordset of data from a SQL table that I am using to populate a drop down box. I then create a seperate record set from a second table for my users to update. The rows returned include this drop down box to help with their selections. This works fine if I am only displaying one row for the user to update. The problem that I am having is when I try to reuse this drop down box for multiple record sets returned to the same page. It only popluates it for the drop down box in the first row even though I have not closed the recordset. Any suggestions? Joe

  2. #2
    Join Date
    Dec 1969

    Default Don't do it...

    ...instead, use the DO loop to put all the &#060;OPTION&#062;s into a *STRING*. Then you just Response.Write the string every time you need the options!<BR><BR>You can also use GETSTRING to create the list of options and save even more time. See the ASPFAQs, category Databases, General (I think) and the FAQ on GETSTRING.<BR><BR>It even shows you how to set the SELECTED attribute on the appropriate OPTION for each usage, if need be.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts