asp 怎样在二级栏目下动态调出三级栏目

2025-01-02 10:57:45
推荐回答(2个)
回答1:

在需要调用的位置加上:<%Call ClassList(0,0)%>

<%

Sub ClassList(bigclass,N)
Set CList_Rs=Conn.execute("select ID,bigclass,lmname from [lanmu] where bigclass="&bigclass&" order by nb")
do while not CList_Rs.eof
for i=1 to N
response.write("--")
next
response.write("")
response.write(CList_Rs("lmname")&"

")'
Call ClassList(CList_Rs("ID"),N+1)
CList_Rs.movenext
loop
CList_Rs.close:set CList_Rs=nothing
End Sub

%>

回答2:

1、sql="select * from lanmu where bigclass=‘“&id&”’ id哪里来的?
2、<%
sql="select * from lanmu where bigclass=‘“&id&”’
Set rs1= Server.CreateObject("ADODB.Recordset")
rs1.open sql,conn,1,1
do while not rs1.eof
%>
"><%=rs("lmname")%>
<%
rs1.movenext
loop
rs1.close
set rs1=nothing
%> 之间的"><%=rs("lmname")%>应该是"><%=rs1("lmname")%>