asp中do while loop的循环嵌套问题
IfRSn.EofAndRSn.BofThenResponse.Write("None")ElseDoWhileNotRSn.EofDoWhileRSn("log_cst...
If RSn.Eof And RSn.Bof Then
Response.Write("None")
Else
Do While Not RSn.Eof
Do While RSn("log_cstitle")=true
Do While RSn("log_jctitle")=true
Newarticle = Newarticle & "<tr><td class=""newline"">[<a target=_blank href='default.asp?CateID="&RSn("log_CateID")&"'>"& RSn("cate_Name") &"</a>]<a target=_blank href=""article.asp?id="&RSn("log_ID")&"""><strong>"&HTMLEncode(cutStr(RSn("log_Title"),21))&"</strong></a></td><td class=""riqi"" width=42>("&month(RSn("log_PostTime"))&"-"&day(RSn("log_PostTime"))&")</td></tr>" 'width=42 控制标题单元格宽度,值越大间距越小
RSn.Movenext
row=row+1
if row=10 then
Exit do
end If
Loop
Newarticle = Newarticle & "<tr><td class=""newline1"">[<a href='default.asp?CateID="&RSn("log_CateID")&"' class=""newline1"" target=_blank>"& RSn("cate_Name") &"</a>]<a target=_blank href=""article.asp?id="&RSn("log_ID")&""">"&HTMLEncode(cutStr(RSn("log_Title"),21))&"</a></td><td class=""riqi"" width=42>("&month(RSn("log_PostTime"))&"-"&day(RSn("log_PostTime"))&")</td></tr>" 'width=42 控制标题单元格宽度,值越大间距越小
RSn.Movenext
row=row+1
if row=10 then
Exit do
end If
Loop
Newarticle = Newarticle & "<tr><td class=""newline"">[<a target=_blank href='default.asp?CateID="&RSn("log_CateID")&"'>"& RSn("cate_Name") &"</a>]<a target=_blank href=""article.asp?id="&RSn("log_ID")&""">"&HTMLEncode(cutStr(RSn("log_Title"),21))&"</a></td><td class=""riqi"" width=42>("&month(RSn("log_PostTime"))&"-"&day(RSn("log_PostTime"))&")</td></tr>" 'width=42 控制标题单元格宽度,值越大间距越小
RSn.Movenext
row=row+1
if row=10 then
Exit do
end If
Loop
End If
这个循环的问题出在哪里啊? 展开
Response.Write("None")
Else
Do While Not RSn.Eof
Do While RSn("log_cstitle")=true
Do While RSn("log_jctitle")=true
Newarticle = Newarticle & "<tr><td class=""newline"">[<a target=_blank href='default.asp?CateID="&RSn("log_CateID")&"'>"& RSn("cate_Name") &"</a>]<a target=_blank href=""article.asp?id="&RSn("log_ID")&"""><strong>"&HTMLEncode(cutStr(RSn("log_Title"),21))&"</strong></a></td><td class=""riqi"" width=42>("&month(RSn("log_PostTime"))&"-"&day(RSn("log_PostTime"))&")</td></tr>" 'width=42 控制标题单元格宽度,值越大间距越小
RSn.Movenext
row=row+1
if row=10 then
Exit do
end If
Loop
Newarticle = Newarticle & "<tr><td class=""newline1"">[<a href='default.asp?CateID="&RSn("log_CateID")&"' class=""newline1"" target=_blank>"& RSn("cate_Name") &"</a>]<a target=_blank href=""article.asp?id="&RSn("log_ID")&""">"&HTMLEncode(cutStr(RSn("log_Title"),21))&"</a></td><td class=""riqi"" width=42>("&month(RSn("log_PostTime"))&"-"&day(RSn("log_PostTime"))&")</td></tr>" 'width=42 控制标题单元格宽度,值越大间距越小
RSn.Movenext
row=row+1
if row=10 then
Exit do
end If
Loop
Newarticle = Newarticle & "<tr><td class=""newline"">[<a target=_blank href='default.asp?CateID="&RSn("log_CateID")&"'>"& RSn("cate_Name") &"</a>]<a target=_blank href=""article.asp?id="&RSn("log_ID")&""">"&HTMLEncode(cutStr(RSn("log_Title"),21))&"</a></td><td class=""riqi"" width=42>("&month(RSn("log_PostTime"))&"-"&day(RSn("log_PostTime"))&")</td></tr>" 'width=42 控制标题单元格宽度,值越大间距越小
RSn.Movenext
row=row+1
if row=10 then
Exit do
end If
Loop
End If
这个循环的问题出在哪里啊? 展开
展开全部
Do While Not RSn.Eof
Do While RSn("log_cstitle")=true
Do While RSn("log_jctitle")=true
这样啊?? 没见过 ,高啊
搞一个循环
Do While Not RSn.Eof and RSn("log_cstitle")=true and RSn("log_jctitle")=true
............
loop
或者
Do While Not RSn.Eof
................
RSn.Movenext
row=row+1
if row=10 then
Exit do
end If
loop
Do While RSn("log_jctitle")=true
...............
Loop
Do While RSn("log_cstitle")=true
Do While RSn("log_jctitle")=true
这样啊?? 没见过 ,高啊
搞一个循环
Do While Not RSn.Eof and RSn("log_cstitle")=true and RSn("log_jctitle")=true
............
loop
或者
Do While Not RSn.Eof
................
RSn.Movenext
row=row+1
if row=10 then
Exit do
end If
loop
Do While RSn("log_jctitle")=true
...............
Loop
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询