•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 402,509 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,818 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: 3320 | Replies: 88 | Solved
![]() |
•
•
Join Date: Sep 2007
Posts: 1,057
Reputation:
Rep Power: 3
Solved Threads: 61
This is how I would do it then, completely:
You have to set a new variable called "Flag1". Set it to False.
Glad to help.
If Not RS.EOF then
Response.Write("<table width=""570"" border=""1"">")
Do Until RS.EOF
Response.Write("<tr>")
For i = 1 To Cols
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
Response.Write("</td>")
Flag1 = False
Else
RS.MoveNext
End If
End If
Next
Response.Write("</tr>")
loop
Response.Write("</table>")
End IfYou have to set a new variable called "Flag1". Set it to False.
Glad to help.
•
•
Join Date: Feb 2008
Posts: 135
Reputation:
Rep Power: 1
Solved Threads: 3
the last code was crashed,
--
Response-objekt fel 'ASP 0251 : 80004005'
Svarsbuffertens längd har överskridits
/NYSITE/category_window.asp, rad 0
Körning av ASP-sidan gjorde att svarsbuffertens storlek överskreds.
--
I did some cut and paste in the earlier uotput source and this is what it should be compared to the one I send before.
<table width='570' border='1'>
<tr>
<td width='190'>Bil, Båt & Motor [Topcategory]<br>-----------------------------<br>
Bilservice [middlecategory]
Bilservice [middlecategory]
Bildelar & Biltillbehör [middlecategory]
</td>
<td width='190'>Butiker & Shopping [Topcategory]<br>-----------------------------<br>
Hälsa & Skönhet [middlecategory]
Bygg & Trädgård [middlecategory]
Hus, Hem & Trädgård [middlecategory]
Film, Musik & Spel [middlecategory]
Mobilt & Telefoni [middlecategory]
Kläder, Mode & Skor [middlecategory]
Glasögon & Kontaktlinser [middlecategory]
Hemelektronik & Foto [middlecategory]
Företag & Kontor [middlecategory]
</td>
<td width='190'>Data, IT & Telekommunikation [Topcategory]<br>-----------------------------<br>
Datorer & Nätverk [middlecategory]
Mobilt & Telefoni [middlecategory]
Internettjänster [middlecategory]
</td>
</tr>
<tr>
<td width='190'>Ekonomi & Juridik [Topcategory]<br>-----------------------------<br>
Advokat- & Juristbyråer [middlecategory]
Administration & Redovisning [middlecategory]
Bank, Finans & Egendom [middlecategory]
</td>
<td width='190'>Industri & Transport [Topcategory]<br>-----------------------------<br>
Åkeri & Transporttjänster [middlecategory]
</td>
<td width='190'>Marknadsföring & Media [Topcategory]<br>-----------------------------<br>
Reklam & Annons [middlecategory]
Internetmarknadsföring [middlecategory]
Design & Formgivning [middlecategory]
PR & Kommunikation [middlecategory]
</td>
</tr>
<tr>
<td width='190'>Sport & Fritid [Topcategory]<br>-----------------------------<br>
Äventyr & Naturupplevelser [middlecategory] </td>
<td width='190'>xx</td>
<td width='190'>xx</td>
</tr>
</table>
--
Response-objekt fel 'ASP 0251 : 80004005'
Svarsbuffertens längd har överskridits
/NYSITE/category_window.asp, rad 0
Körning av ASP-sidan gjorde att svarsbuffertens storlek överskreds.
--
I did some cut and paste in the earlier uotput source and this is what it should be compared to the one I send before.
<table width='570' border='1'>
<tr>
<td width='190'>Bil, Båt & Motor [Topcategory]<br>-----------------------------<br>
Bilservice [middlecategory]
Bilservice [middlecategory]
Bildelar & Biltillbehör [middlecategory]
</td>
<td width='190'>Butiker & Shopping [Topcategory]<br>-----------------------------<br>
Hälsa & Skönhet [middlecategory]
Bygg & Trädgård [middlecategory]
Hus, Hem & Trädgård [middlecategory]
Film, Musik & Spel [middlecategory]
Mobilt & Telefoni [middlecategory]
Kläder, Mode & Skor [middlecategory]
Glasögon & Kontaktlinser [middlecategory]
Hemelektronik & Foto [middlecategory]
Företag & Kontor [middlecategory]
</td>
<td width='190'>Data, IT & Telekommunikation [Topcategory]<br>-----------------------------<br>
Datorer & Nätverk [middlecategory]
Mobilt & Telefoni [middlecategory]
Internettjänster [middlecategory]
</td>
</tr>
<tr>
<td width='190'>Ekonomi & Juridik [Topcategory]<br>-----------------------------<br>
Advokat- & Juristbyråer [middlecategory]
Administration & Redovisning [middlecategory]
Bank, Finans & Egendom [middlecategory]
</td>
<td width='190'>Industri & Transport [Topcategory]<br>-----------------------------<br>
Åkeri & Transporttjänster [middlecategory]
</td>
<td width='190'>Marknadsföring & Media [Topcategory]<br>-----------------------------<br>
Reklam & Annons [middlecategory]
Internetmarknadsföring [middlecategory]
Design & Formgivning [middlecategory]
PR & Kommunikation [middlecategory]
</td>
</tr>
<tr>
<td width='190'>Sport & Fritid [Topcategory]<br>-----------------------------<br>
Äventyr & Naturupplevelser [middlecategory] </td>
<td width='190'>xx</td>
<td width='190'>xx</td>
</tr>
</table>
Last edited by TobbeK : Feb 14th, 2008 at 3:56 pm.
•
•
Join Date: Feb 2008
Posts: 135
Reputation:
Rep Power: 1
Solved Threads: 3
It hangs, no error
Here is my full code
response.buffer="true"
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 "
RS.Open SQL,Conn
If Not RS.EOF then
Response.Write("<table width=""570"" border=""1"">")
Do Until RS.EOF
response.flush
Response.Write("<tr>")
For i = 1 To Cols
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
Here is my full code
response.buffer="true"
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 "
RS.Open SQL,Conn
If Not RS.EOF then
Response.Write("<table width=""570"" border=""1"">")
Do Until RS.EOF
response.flush
Response.Write("<tr>")
For i = 1 To Cols
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: 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.
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.
Last edited by TobbeK : Feb 14th, 2008 at 4:29 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