循环语句,asp循环,asp双循环,asp嵌套循环.
急,在线等<%'A表setrsMenu=server.createobject("ADODB.recordset")msSql="select*frommb_so_typ...
急,在线等
<%
'A表
set rsMenu = server.createobject("ADODB.recordset")
msSql = "select * from mb_so_type where sts='A' and Type_sts not in ('0') AND Type_Type='deal'"
rsMenu.open msSql,Conn,3,1
%>
<%
'B表 读取 A 的 Type_ID 来循环
set rsMenuTwo = server.createobject("ADODB.recordset")
msSql = "select * from mb_so_status where sts='A' and Type_ID='"&rsMenu("Type_ID")&"'"
rsMenuTwo.open msSql,Conn,3,1
%>
<ul id="btns9" class="fu_ul">
<!--这里循环A表的内容-->
<li><a>A表的内容</a></li>
</ul>
<!--这里循环B表,用A表的TYPE_id 来循环>
<div class="wmenu">
<ul>
<li class="lia"><a>B表的内容</a></li>
</ul>
</div> 展开
<%
'A表
set rsMenu = server.createobject("ADODB.recordset")
msSql = "select * from mb_so_type where sts='A' and Type_sts not in ('0') AND Type_Type='deal'"
rsMenu.open msSql,Conn,3,1
%>
<%
'B表 读取 A 的 Type_ID 来循环
set rsMenuTwo = server.createobject("ADODB.recordset")
msSql = "select * from mb_so_status where sts='A' and Type_ID='"&rsMenu("Type_ID")&"'"
rsMenuTwo.open msSql,Conn,3,1
%>
<ul id="btns9" class="fu_ul">
<!--这里循环A表的内容-->
<li><a>A表的内容</a></li>
</ul>
<!--这里循环B表,用A表的TYPE_id 来循环>
<div class="wmenu">
<ul>
<li class="lia"><a>B表的内容</a></li>
</ul>
</div> 展开
展开全部
其实你可以用一个SQL语句来得到记录集.
do while not rsMenu.eof
set rsMenuTwo = server.createobject("ADODB.recordset")
msSql = "select * from mb_so_status where sts='A' and Type_ID='"&rsMenu("Type_ID")&"'"
rsMenuTwo.open msSql,Conn,3,1
"输出A表内容"
do while not rsMenuTwo.eof
"输出B表内容"
rsMenuTwo.movenext
loop
rsMenuTwo.close
set rsMenuTwo=thiong
rsMenu.movenext
loop
rsMenu.close
set rsMenu=thiong
do while not rsMenu.eof
set rsMenuTwo = server.createobject("ADODB.recordset")
msSql = "select * from mb_so_status where sts='A' and Type_ID='"&rsMenu("Type_ID")&"'"
rsMenuTwo.open msSql,Conn,3,1
"输出A表内容"
do while not rsMenuTwo.eof
"输出B表内容"
rsMenuTwo.movenext
loop
rsMenuTwo.close
set rsMenuTwo=thiong
rsMenu.movenext
loop
rsMenu.close
set rsMenu=thiong
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询