Re: Do While Loop nested in another While causes error
- From: "Mal Reeve" <mal_lori@xxxxxxxxxxx>
- Date: Fri, 17 Nov 2006 12:44:12 GMT
I was summarizing the code...sorry.
Here is the applicable loops in question, thanks for any advice.
Mal.
-----------------------------------------------
'This code follows other page elements.
' Error occurs at second DO loop
rsGuestbook.Open strSQL, adoCon
Response.Write("<table width='100%' border='0' cellpadding='0'
cellspacing='0' bordercolor='#FFFFFF'>")
Dim idHolder
'Loop through the recordset
Do While not rsGuestbook.EOF
Response.Write ("<tr>")
Response.Write ("<td width='15%' valign='top'><font
color='#336633'>First Name: </font></td>")
Response.Write ("<td><strong>")
Response.Write(rsGuestbook("tblAlumniFirstName"))
Response.Write ("</font></td></tr><tr>")
Response.Write ("<td valign='top'></strong><font color='#336633'>Last
Name: </td>")
Response.Write ("<td><strong>")
Response.Write (rsGuestbook("tblAlumniLastName"))
Response.Write ("</font></td></strong></tr>")
if len(rsGuestbook("tblAlumniMaidName")) > 3 then
Response.Write ("<td valign='top'><font color='#336633'>Maiden
Name: </td>")
Response.Write ("<td>")
Response.Write (rsGuestbook("tblAlumniMaidName"))
Response.Write ("</td></tr>")
end if
Response.Write ("<tr>")
Response.Write ("<td valign='top'><font color='#336633'>Email: </td>")
Response.Write ("<td>")
Response.Write (rsGuestbook("tblAlumniEmail"))
Response.Write ("</td></tr><tr>")
Response.Write ("<td valign='top'><font color='#336633'>Last Updated:
</td>")
Response.Write ("<td>")
Response.Write(rsGuestbook("tblAlumniDateUpdated"))
Response.Write ("</td></tr><tr>")
Response.Write ("<td colspan='2'
align='center'>----------------------------------------------------------------")
Response.Write ("</td></tr>")
idHolder = rsGuestbook("tblAlumniID")
'This loop keeps moving to the next record until it has a different ID
number. ie. A different person
Do until rsGuestbook("tblAlumniID") <> idHolder
rsGuestbook.MoveNext
loop
Loop
'Reset server objects
rsGuestbook.Close
Set rsGuestbook = Nothing
Set adoCon = Nothing
"jane" <bidepan@xxxxxxx> wrote in message
news:%23H$G4kdCHHA.3836@xxxxxxxxxxxxxxxxxxxxxxx
I don't know if you posted your code completely, as so far, there are
following problems
1. the outter loop, why do you have two different recordset name?
myRecordset,rsMyRecordset, are these two indicated one recordset?
2. you don't make a move in outter loop,reMyRecordset.movenext?
3. did you define recordset "reGuestbook"? can not tell from your code.
And make sure rsGuestbook isn't null before the inner loop, like adding if
not eof.
hope these help
"Mal Reeve" <mal_lori@xxxxxxxxxxx> wrote in message
news:hh57h.7074$0r.2737@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello,
I have a very basic Page that reads from a database and displays the
information
To display I use a the following basic setup.
Do While Not myRecordset.EOF
...display the info I want in a table.
idHolder = rsMYRecordset("tblAlumniID")
Do until rsGuestbook("tblAlumniID") <> idHolder **this line is
referenced in the error message
rsGuestbook.MoveNext
Loop
Loop
My recordset returns multiple hits for many people (represents multiple
years) I use this inner Do/While Loop to skip displaying duplicates.
It causes an error '80020009' on the DO UNTIL (nested) loop.
After displaying the error message, it then continues and correctly
displays the data.
I am very much still a noob with ASP.
Any Advice?
Mal.
.
- Follow-Ups:
- Re: Do While Loop nested in another While causes error
- From: Mike Brind
- Re: Do While Loop nested in another While causes error
- References:
- Do While Loop nested in another While causes error
- From: Mal Reeve
- Re: Do While Loop nested in another While causes error
- From: jane
- Do While Loop nested in another While causes error
- Prev by Date: Re: Leading Zeros dropped in date returned from SQL Data using ASP
- Next by Date: Re: Do While Loop nested in another While causes error
- Previous by thread: Re: Do While Loop nested in another While causes error
- Next by thread: Re: Do While Loop nested in another While causes error
- Index(es):
Relevant Pages
|