Wrox Programmer Forums
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 5th, 2009, 04:20 PM
Authorized User
Join Date: Apr 2009
Posts: 15
Thanks: 3
Thanked 0 Times in 0 Posts
Default errors with nested Do While Loops

I am trying to duplicate some one else's report with a web page. The report looks like an outline.
The way I have accomplished this it with a three deep nested Do While Loop and three recordsets here is the code;
If Recordset Then %>
    <tr><th>Part Used</th><th>Symptom Code</th><th>Symptom Description</th><th>Part Notes</th><th>Total</th></tr>
<% Do While Not rs1.EOF %>
    <tr><td><%=rs1("replacementPartNumber") %>&nbsp;</td><td><%=rs1("description") %>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td><%=rs1("total") %>&nbsp;</td></tr>
        Do While rs1("replacementPartNumber") = rs2("replacementPartNumber")%>
        <tr><td>&nbsp;</td><td><%=rs2("symptomCode") %>&nbsp;</td><td><%= rs2("sympDesc") %>&nbsp;</td><td>&nbsp;</td><td><%=rs2("test") %>&nbsp;</td></tr>
            Do While rs2("symptomCode") = rs("symptomCode")
            <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td><%=rs("test2") %>&nbsp;</td><td><%=rs("test") %>&nbsp;</td></tr>
    rs1.MoveFirst %>
Set rs = Nothing
Set rs1 = Nothing
Set rs2 = Nothing
End If
I tried to take out as much of the HTML style coding to make it easier to read.
My problem is that it runs and gives me the expected results except right above the table it displays an error message;

error '80020009'
/testdev/davie/davieworking/citizenPartUsageData.asp, line 71

line 71 is the inner most Do While statement.
If I remove the inner most Do While Loop the same error occurs at the "new" inner most loop.
Any help would be appreciated

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nested Loops in SQL Query values from table/set miamikk SQL Server 2000 1 August 31st, 2007 12:35 AM
break for-each loops, or limit amount of loops warhero XSLT 2 July 4th, 2007 02:18 AM
strange "errors" with nested master pages... thenoseknows ASP.NET 2.0 Professional 2 November 28th, 2006 05:28 PM
weird program flow with nested loops zayasv Intro Programming 2 November 17th, 2005 06:19 AM
problem with nested loops ptaylor2005 Beginning PHP 4 April 27th, 2005 07:05 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.