无限分类菜单(紧急问题)

noon808 2003-08-22 03:52:46
调用的一个函数
这个是显示页面
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<!--#include file="fun.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>超级管理员管理</title>
<link href="css.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0">
<table width="770" border="0" align="center" cellspacing="1">
<tr>
<td width="141" valign="top"></td>
<td width="619" valign="top">
<table width="600" border="0" align="center" cellspacing="1" bgcolor="#CCCCCC" class="text">
<!--#include file="conn.asp"-->
<%
set rs=server.CreateObject("adodb.recordset")
sql="select count(*) from deeptree where parentid = T.id"
sql="select *,("&sql&") as children from deeptree T where parentid=0"&" order by id"
rs.open sql,conn,1,1
do while not rs.eof
%>
<%
response.Write("<tr bgcolor=""#FF9900""><td width=""393"">"&rs("content")&"</td>")
response.Write("<td width=""200"" align=""center"">")
response.Write("<a href=""class_add.asp?id="&rs("id")&""">增加同类</a>|<a href=""#"">增加子类</a>|<a href=""#"">编辑</a>|<a href=""#"">删除</a>")
response.Write("</td></tr>")
if rs("children")>0 then
call showother(rs("id"),1)
end if
%>
<%
rs.movenext
loop
conn.close
set conn=nothing
%>
</table>
</td>
</tr>
</table>
</body>
</html>
'+++++++++++++++++++++++++++++++++++++++++++函数
function showother(someid,num)
dim a,b,aa
set rs1 = Server.CreateObject("ADODB.Recordset")
sql1="select count(*) from deeptree where parentid = T.id"
sql1="select *,("&sql1&") as children from deeptree T where parentid="&cint(someid)&" order by id"
rs1.Open sql1,conn,3,3
a=rs1.recordcount
for b=1 to a
if b=a then
aa="└"
else
aa="├"
end if
response.Write("<tr bgcolor=""#FFFFFF""><td width=""323"">"&replace(space(num-1),chr(32)," ")&aa&rs1("content"))
response.Write("</td><td align=""center"">")
response.Write("<a href=""#"">增加同类</a>|<a href=""#"">增加子类</a>|<a href=""#"">编辑</a>|<a href=""#"">删除</a>")
response.Write("</td></tr>")
if rs1("children")>0 then
call showother(cint(rs1("id")),cint(num)+1)
end if
next
rs1.close
end function
'大家帮忙啊
得到的结果是错误
...全文
106 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
fason 2003-08-22
  • 打赏
  • 举报
回复
http://fason.nease.net/
tigerwen01 2003-08-22
  • 打赏
  • 举报
回复
可能在修改方面有错误,请细查。
noon808 2003-08-22
  • 打赏
  • 举报
回复
代码可以从这里下载,请大家帮帮忙呀,要不周六还要加班呀。
http://to.pnnic.com/ybbh/tree.zip

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧