Marro2 Posted December 23, 2008 Share Posted December 23, 2008 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 More sharing options...
jeffman Posted December 23, 2008 Share Posted December 23, 2008 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 More sharing options...
Marro2 Posted December 24, 2008 Author Share Posted December 24, 2008 Figured out what I need to do to reset the record set.because the rsY is at the EOF once the loop is done I need to do a rsY.moveFirstso I just need to add a linersY.movenextlooprsY.moveFirstrsX.movenextloop Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.