Do While Loop Problems
This is part of the code i have and i keep getting the following error with my Loops:
Microsoft VBScript compilation error '800a040e'
'loop' without 'do'
/default.asp, line 72
Loop
^
This is the SCRIPT:
Do While Not Cat.EOF
If Session("CatID"&Cat("CatID")) = "Y" Then
Display = "N"
Image = "images/icon_minus.gif"
Else
Display = "Y"
Image = "images/icon_plus.gif"
End If
If Session("CatID"&Cat("CatID")) = "Y" Then
SubCat.Open "Select * from SubCategories Where CatID="&Cat("CatID"),ObjConn,1,2
Response.Write("<tr bgcolor=#CCCCCC>")
Response.Write("<td colspan=6><a href=default.asp?CatID="&Cat("CatID")&"&Display="& Display&"><img src="&Image&" border=0></a> "&Cat("CatName")&"</td>")
Response.Write("<td> </td>")
Response.Write("</tr>")
Do While Not SubCat.EOF
Response.Write("<tr>")
Response.Write("<td> </td>")
Response.Write("<td><a href=forum.asp?ForumID="&SubCat("SubCat")&">"&SubC at("SubCatName")&"</a><br>"&SubCat("SubCatDesc")&"<td>")
Response.Write("<td>"&SubCat("TotalTopics")&"</td>")
Response.Write("<td>"&SubCat("TotalPosts")&"</td>")
Response.Write("<td> </td>")
Response.Write("<td> </td>")
Response.Write("<td> </td>")
Response.Write("</tr>")
SubCat.MoveNext
Loop
SubCat.Close
Set SubCat = Nothing
Cat.MoveNext
Loop
Cat.Close
Set Cat = Nothing
|