asp中如何实现多层循环
asp中如何实现多层循环
代码如下:
<!--#include file="conn.asp"-->
<%
if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆!');location.href='index.asp';</script>"
response.End
else
if session("flag")=2 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限!</b></font></div>"
response.End
end if
end if
sql="select anclass from probcla order by anclassidorder"
set rs=server.CreateObject("ADODB.Recordset")
rs.Open sql,conn,1,3
%>
<html>
<head>
<title>二级目录列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css/main.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#799AE1" style="margin:0px">
<table width="100%" border="0" cellpadding="4" cellspacing="1" class="TableBg">
<tr align="center">
<td colspan="5" class="TdContent"><font color="#FF0000">二级目录列表</font></td>
</tr>
<tr align="center" class="TrDefault">
<td width="23%">一级目录分类名称</td>
<td width="27%">二级目录分类名称</td>
<td width="14%">分类排序</td>
<td width="14%">常用分类</td>
<td width="22%">操 作</td>
</tr>
<%
while not rs.eof
%>
<%
sqlstr1="select * from probcla order by nclassidorder "
set rs1=server.CreateObject("ADODB.Recordset")
rs1.Open sqlstr1,conn1,1,3
while not rs1.eof
%>
<tr align="center" bgcolor="#FFFFFF" onmouseover="this.style.backgroundColor='#BFDFFF'" onmouseout="this.style.backgroundColor=''">
<td><%=rs("anclass")%></td>
<td><%=rs1("nclass")%></td>
<td><%=rs1("nclassidorder")%></td>
<td>
<%
if rs1("changyong")=1 then
response.Write "<font color=red>常用</font>"
else
response.Write "增加"
end if
%>
</td>
<td><a href="twoSubjectDel.asp?nclassid=<%=rs("nclassid")%>">删除</a><a href="twoSubjectUpdate.asp?nclassid=<%=rs("nclassid")%>"> 修改</a></td>
</tr>
<%
rs1.movenext
wend
%>
<%
rs.movenext
wend
%>
</table>
<div id="showIframe" style="display:block">
<tr class="TdContent">
<td align="center"><iframe id="colFrame" name="colFrame" width=100% Frameborder=No Border=0 Marginwidth=0 Marginheight=0 scrolling=auto src="twoSubjectAdd.asp"></iframe></td>
</tr>
</div>
</body>
</html>
<%
rs1.close
set rs1=nothing
conn.close
set conn=nothing
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
问题点数:2、回复次数:2Top
1 楼dh20156(风之石)回复于 2006-03-02 13:43:57 得分 0
递归或者在SQL查询里做Top
2 楼csyu85(深情的一吻)回复于 2006-03-02 15:12:47 得分 0
我之前写过一段传销的程序,你要我可以发你参考下
.com域名60元,.cn .net域名58元,80M asp空间105元,网站建设2000元每套http://www.xinsoft.net.cnTop




