• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 565
  • Last Modified:

In Classic ASP, How do I convert "Next" query to "Do Until...Loop" query?

I have a query that uses "Next" query. What if I want to use Do Until....Loop query, How do I convert this query to that?
Thank you.

+++++++++++++++++My coding+++++++++++++++++++++++++++++++++++++++++++
<%
Dim itemcount
Itemcount=rs.pagesize

For 1 to Itemcount
%>

<Table>
<tr>
 <td><%=rs("name")%></td>
</tr>
<Table>

<% rs.MoveNext
Next %>
0
erin027
Asked:
erin027
  • 2
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
here we go, using the rs.eof property:
<% 
while not rs.eof
%> 
<Table>
<tr>
 <td><%=rs("name")%></td>
</tr>
<Table> 
<%  
  rs.MoveNext
wend
%>

Open in new window

0
 
erin027Author Commented:
Thanks angellll.
But I need the data from 1 to Itemcount only.
I am trying to display the certain data on each page.
Instead of rs.EOF is there anyway that I can bring data that is from 1 to itemcount?
itemcount is rs.pagesize.

I have rest of the coding but it's too much to post it up. I just need if I can use Do Until...loop query in this situation.
Thank you.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
why do you want to change from the FOR .. to a WHILE loop actually?

anyhow:
<%
Dim itemcount
Dim l
Itemcount=rs.pagesize
l = 1
 
while l < Itemcount
%>
 
<Table>
<tr>
 <td><%=rs("name")%></td>
</tr>
<Table>
 
<% 
  rs.MoveNext
  l = l + 1
wend %>

Open in new window

0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now