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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Numbering with a do-loop within a while-wend 2

Status
Not open for further replies.

Sonrie

Programmer
May 9, 2003
14
NO
Hello,

I have made a table where I print out data from a database. I would like to number all of the rows using this code:
Code:
<%
Do While Not rs.EOF
i = 0
Response.Write(i)
i = i + 1
Loop
%>
This should appear within this code:
Code:
<% While ((Repeat1__numRows <> 0) AND (NOT rs.EOF)) %>
...
Code:
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs.MoveNext()
Wend
%>
Can someone please help me out?

Sincerely,
Sonrie
 
Don't you want your
i = 0
to be outside your
Do While Not rs.EOF
?
 
You need to move you i = 0 outside the loop or it will reset every time

<%
i=0
While ((Repeat1__numRows <> 0) AND (NOT rs.EOF))
%>

...

<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs.MoveNext()
i=i+1
Wend
%>

BDC.
 
Hehe, yes, I do! ;O)

Thanks for the tip.

-Sonrie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top