ASP Classic RecordSet loop

Posted on 2015-02-19
Last Modified: 2015-02-24
I have a page in asp that calls different recordsets, In order to write this on a simple txt page we created this loop:

Do until rs_usermap.EOF
redim lista(cont)
lista(cont) = " + "&  rs_usermap("QFrsvalue")
valor = rs_usermap("QFrsvalue")
rs =Mid( valor, InStr(valor,  "rs_"), InStr(valor, ".Fields")-2)
inicio = InStr( valor, "(" & Chr(34))+2
 fin = InStr(valor,  "Val")-3
    field = Mid(valor, inicio, fin - inicio)

Case "rs_Beneficiary"
    If Not rs_Beneficiary.EOF then
      Response.Write rs_Beneficiary(field)
    End If
Select Case rs
  Case "rs_attorneys"
    If Not rs_attorneys.EOF then
      Response.Write rs_attorneys(field)
    End If
cont=cont +1

Now, the problem I have is that "rs_attorneys" has more than 1 row on the recordset.
How could I program the loop so that it writes all the rows on "rs_attorneys" and then move to the next recordset ?
Question by:amucinobluedot
  • 3
LVL 33

Accepted Solution

Big Monty earned 500 total points
ID: 40619650
Try this:

Select Case rs
  Case "rs_attorneys"
    If Not rs_attorneys.EOF then
       Do while not rs_attorneys.eof
           '-- write out your fields here
            Response.Write rs_attorneys(field)
    End If
LVL 33

Expert Comment

by:Big Monty
ID: 40625816
did this resolve your issue?

Author Comment

ID: 40627479
Sorry Big, it worked perfectly.

Thank You!!
LVL 33

Expert Comment

by:Big Monty
ID: 40627983
No prob just wanted to make sure you got it working

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question