•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 427,218 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,201 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 3641 | Replies: 88 | Solved
![]() |
•
•
Join Date: Feb 2008
Posts: 135
Reputation:
Rep Power: 1
Solved Threads: 3
•
•
•
•
I'm old fashion guy so I will stick to the classic. You are right I should update myselfl and my coding some day.
Can i send you the access db. I have make it with the same table structure and names. Maybe it easier to see it live.
There is only 20 posts in the DB so it should not hang things up.
I have tested the LIMIT 20 and there still erroring.
There you have the zipped test db
•
•
Join Date: Sep 2007
Posts: 1,057
Reputation:
Rep Power: 4
Solved Threads: 61
hey, want to know why it errors? lol
It is never finding an end. There's a mistake in the code, and it's where it says "cols"
Remove cols, and have just "3".
For i=1 to 3
And it wont hang. Enjoy.
Oh, also remove response.buffer, and the response.flush.
It is never finding an end. There's a mistake in the code, and it's where it says "cols"
Remove cols, and have just "3".
For i=1 to 3
And it wont hang. Enjoy.
Oh, also remove response.buffer, and the response.flush.
Last edited by SheSaidImaPregy : Feb 14th, 2008 at 5:13 pm.
•
•
Join Date: Feb 2008
Posts: 135
Reputation:
Rep Power: 1
Solved Threads: 3
Nope :-)
Check the attach
SQL = "SELECT DISTINCT TC.topcategory,MC.middlecategory "&_
"FROM tbtopcategory TC,tbmiddlecategory MC,tbconnectcategory CC "&_
"WHERE TC.topcategoryID = CC.topcategorylink "&_
"AND MC.tbmiddlecategoryID = CC.middlecategorylink " &_
"GROUP BY TC.topcategory,MC.middlecategory ASC "
RS.Open SQL,Conn
If Not RS.EOF then
Response.Write("<table width='570' border='1'>")
Do Until RS.EOF
Response.Write("<tr>")
For i = 1 To 3
If Not RS.EOF Then
TopCat = RS("topcategory")
MiddleCat = RS("middlecategory")
If LastTopCat <> TopCat and Flag1 = False Then
Response.Write("<td width='190'>")
End If
If LastTopCat <> TopCat and Flag1 = False Then
Response.Write(RS("topcategory") & "<br>")
Response.Write("-----------------------------<br>")
LastTopCat = TopCat
Flag1 = True
End If
If MiddleCat <> "" and LastTopCat = TopCat and Flag1 = True Then
Response.Write(MiddleCat)
End If
If LastTopCat <> TopCat and Flag1 = True Then
Response.Write("</td>")
Flag1 = False
Else
RS.MoveNext
End If
End If
Next
Response.Write("</tr>")
loop
Response.Write("</table>")
End If
Conn.Close
Check the attach
SQL = "SELECT DISTINCT TC.topcategory,MC.middlecategory "&_
"FROM tbtopcategory TC,tbmiddlecategory MC,tbconnectcategory CC "&_
"WHERE TC.topcategoryID = CC.topcategorylink "&_
"AND MC.tbmiddlecategoryID = CC.middlecategorylink " &_
"GROUP BY TC.topcategory,MC.middlecategory ASC "
RS.Open SQL,Conn
If Not RS.EOF then
Response.Write("<table width='570' border='1'>")
Do Until RS.EOF
Response.Write("<tr>")
For i = 1 To 3
If Not RS.EOF Then
TopCat = RS("topcategory")
MiddleCat = RS("middlecategory")
If LastTopCat <> TopCat and Flag1 = False Then
Response.Write("<td width='190'>")
End If
If LastTopCat <> TopCat and Flag1 = False Then
Response.Write(RS("topcategory") & "<br>")
Response.Write("-----------------------------<br>")
LastTopCat = TopCat
Flag1 = True
End If
If MiddleCat <> "" and LastTopCat = TopCat and Flag1 = True Then
Response.Write(MiddleCat)
End If
If LastTopCat <> TopCat and Flag1 = True Then
Response.Write("</td>")
Flag1 = False
Else
RS.MoveNext
End If
End If
Next
Response.Write("</tr>")
loop
Response.Write("</table>")
End If
Conn.Close
•
•
Join Date: Sep 2007
Posts: 1,057
Reputation:
Rep Power: 4
Solved Threads: 61
lmao. Doing 4 different tasks is a bit much for me I guess. Of course that won't work lol.
Try this:
Try this:
If Not RS.EOF then
Response.Write("<table width=""570"" border=""1"">")
Do Until RS.EOF
Response.Write("<tr>")
For i = 1 To 3
If Not RS.EOF Then
Response.Write("<td width='190'>")
Do Until LastTopCat <> TopCat
TopCat = RS("topcategory")
MiddleCat = RS("middlecategory")
If LastTopCat <> TopCat Then
Response.Write(RS("topcategory") & "<br>")
Response.Write("-----------------------------<br>")
LastTopCat = TopCat
End If
If MiddleCat <> "" and LastTopCat = TopCat Then
Response.Write(MiddleCat)
End If
RS.MoveNext
Loop
Response.Write("</td>")
End If
Next
Response.Write("</tr>")
Loop
Response.Write("</table>")
End If•
•
Join Date: Sep 2007
Posts: 1,057
Reputation:
Rep Power: 4
Solved Threads: 61
Oh yeah forgot to check for EOF on that portion. Here you go:
If Not RS.EOF then
Response.Write("<table width=""570"" border=""1"">")
Do Until RS.EOF
Response.Write("<tr>")
For i = 1 To 3
If Not RS.EOF Then
Response.Write("<td width='190'>")
Do Until LastTopCat <> TopCat
If Not Rs.EOF Then
TopCat = RS("topcategory")
MiddleCat = RS("middlecategory")
If LastTopCat <> TopCat Then
Response.Write(RS("topcategory") & "<br>")
Response.Write("-----------------------------<br>")
LastTopCat = TopCat
End If
If MiddleCat <> "" and LastTopCat = TopCat Then
Response.Write(MiddleCat)
End If
RS.MoveNext
If Not RS.EOF Then
TopCat = RS("topcategory")
End If
End If
Loop
Response.Write("</td>")
End If
Next
Response.Write("</tr>")
Loop
Response.Write("</table>")
End If Last edited by SheSaidImaPregy : Feb 14th, 2008 at 5:43 pm.
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- nested for loop problem (Java)
- Can not enter multiple data into nested while loop (C++)
- problem creating a for loop for an array (C++)
- Nested loop that runs until user enters 'q' (C++)
- Do/While Loop help (C++)
- QBasic Nested for loop (Legacy and Other Languages)
- need help w/for loop (C++)
Other Threads in the ASP Forum
- Previous Thread: Help: passing variable via table field different page subroutine
- Next Thread: Convert Int to string classic asp



Linear Mode