Jump to content

Nested Do While


Marro2

Recommended Posts

I am trying to create a nested do while loopIssue is on the inner loop it appears to only do the loop once then proceeds to finish the outer loop. what I want to have happen is every time the outer loop loops it would do the inner loop again.I have to two record sources.For example rsX and rsY.do while not rsX.EOFresponse.write(rsX("Product") &" ") do while not rsY.EOF if rsY("Product") = rsX("Product") then response.write(rsY("Qty")&"<br />") else response.write("<br />") end if rsY.movenext looprsX.movenextlooprsY.closeset rsY = nothingrsX.closeset rsX = nothing-----------------Lets say I have 5 product and for 3 of these products I have a qty. The out put would look something like this.Product | QTYA | 200B |C |D |E |I am new at this stuff so any help, wisdom is appreciated.

Link to comment
Share on other sites

I'm not a vbscript person, but I am around and not many others seem to be here. :)In the inner loop, rsY moves to the next record until it reaches EOF. In the second iteration of the outer loop, isn't rsY already at EOF? Doesn't it need to be reset somehow before it can start looping again?(Or maybe I'm missing something obvious because I don't know the language.)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...