28,391
社区成员
发帖
与我相关
我的任务
分享
<td>新闻类型:</td><td><select name="nclass" onChange="changeselect1(this.value)" tabindex="5">
<option value="0">请选择新闻类型</option>
<%
set rs=server.CreateObject("adodb.recordset")
sql = "select * from class order by id"
rs.open sql,conn,1,1
if not (rs.eof or rs.bof) then
do while not rs.eof
if nclass = rs("id") then s = " selected " else s = ""
response.Write "<option value='"&rs("id")&"' "&s&">"&rs("title")&"</option>"&vblf
rs.movenext
loop
end if
rs.close
%>
</select></td></tr>
<%
sort(0)
dim ii
ii=0
sub sort(myid)'递归
sql="select * from 你的无限分类表 where 父类id字段 = "&myid&" order by autoID"
set rsLAONA=Conn.Execute(sql)
do while not rsLAONA.eof
if myid=0 then
'写你的HTML代码
'............
else
'写你的HTML代码,加符号等等
'............
end if
'写你的HTML代码
'.............
ii=ii+1
sort rsLAONA("你的序号ID字段")
ii=ii-1
rsLAONA.movenext
loop
rsLAONA.close
set rsLAONA= nothing
end sub
%>
<%
action=request.QueryString("action")
set rs=server.CreateObject("adodb.recordset")
sql1="select * from class order by id"
rs.open sql1,conn,1,1
pid=rs("pid")
rs.close
set rs=nothing
%>
.....
<select name="nclass" onChange="changeselect1(this.value)" tabindex="5">
<option value="0">请选择新闻类型</option>
<%
num=0
call selectlist(0,num)
sub selectlist(pid,num)
if num <0 then num=0
set rs=server.CreateObject("adodb.recordset")
sql="select * from class where pid=" & pid '35行 这里报错
'response.Write sql
rs.open sql,conn,1,1
while not rs.eof
%>
<option value="<%=rs("id")%>"><%=string(num*2,"-")%><%=rs("title")%></option>
<%
call selectlist(rs("id"),num+1)
num=num-1
rs.movenext
wend
rs.close
set rs=nothing
end sub
%>
</select>