ASP无级分类解决方案
来源:互联网 发布:红色警戒 for mac 编辑:程序博客网 时间:2024/06/11 20:44
<%
db="db1.mdb"
Set Licns = Server.CreateObject("ADODB.Connection")
Licnsstr="DBQ="+server.mappath(db)+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
On Error Resume Next
Licns.open Licnsstr
If Err Then
err.Clear
Set Licns = Nothing
Response.Write "数据库连接出错,请检查连接字串。"
Response.End
End If
action=request.querystring("action")
if action="tyadd" then
'所有父级,级别,类型
name=request.form("name")'名称,
pareid=request.form("pareid")
orders=request.form("orders")
if pareid<>0 then
retylist1="select * from ty where id="&pareid
set retylist01=Licns.execute(retylist1)
depth=retylist01("depth")+1
parestr=retylist01("parestr")
rootid=retylist01("rootid")
retylist01=close:set retylist01=nothing
else
depth=0
parestr="0"
set maxrootid=Licns.execute("select max(rootid) from ty")
rootid=maxrootid(0)+1
maxrootid.close:set maxrootid=nothing
if isnull(rootid) then rootid=1
end if
set rs=server.createobject("adodb.recordset")
rs.open "ty",Licns,1,3
rs.addnew
rs("name")=name
rs("pareid")=pareid
rs("depth")=depth
rs("orders")=orders
rs("rootid")=rootid
rs("child")=0
rs.update
rs("parestr")=rs("id")&","&parestr '所有父级
rs.update
rs.close
Licns.execute("update ty set child=child+1 where id="&pareid) '若栏目增加子栏目,则+1
response.redirect "index.asp"
end if
taadd01=""
taadd01=taadd01+"<b><font color=red>[无级分类示范]</font></b>制作:默飞 QQ:33224360 更多下载:<a href=http://mofei.xinxiu.com>http://mofei.xinxiu.com</a>"
taadd01=taadd01+"<form method=post name=mofeiform action='?action=tyadd'>"
taadd01=taadd01+"名称:<input name=name type=text> 顺序:<input name=orders type=text size=6>"
taadd01=taadd01+"<select name=pareid>"
'栏目列表,列出属于
set tylist01=Licns.execute("select * from ty")
do while not tylist01.eof
taadd01=taadd01+"<option value='"&tylist01("id")&"'>"&tylist01("name")&"</option>"
tylist01.movenext
loop
tylist01.close
set tylist01=nothing
taadd01=taadd01+"<option value='0'>根目录</option>"
taadd01=taadd01+"</select>"
taadd01=taadd01+"<input type=submit name=submit01 value='增加' disabled> 由于是演示,增加按钮被我屏蔽了."
taadd01=taadd01+"</form>"
response.write taadd01
response.write "<table width=100% border=0 align=center cellpadding=2 cellspacing=0>"
sqllist="select id,name,pareid,depth,child from ty order by rootid,orders"
'栏目ID-0,名称-1,父级-2,级别-3,子集-4
set rslist = Licns.execute(sqllist)
SQL=rslist.getrows(-1)
For iii=0 To Ubound(SQL,2) '根据父级来循环
response.write "<tr height=28><td>"
if SQL(3,iii)>0 then '若不是根目录,输出空格,级别后,加空格
for i=1 to SQL(3,iii)
Response.Write " " '级别>0后,加空格
next
end if
if SQL(4,iii)>0 then '若存在子集,换图标了
Response.Write " + " '明显,存在着子集的,
else
Response.Write " - " '输出不存在子集的
end if
if SQL(2,iii)=0 then '如果是根目录的话
Response.Write "<b>" '如果是大类,就用粗体显示了
end if
Response.Write SQL(1,iii) '这个自然是名称了
if SQL(4,iii)>0 then '若有子集的话,输出了.
Response.Write "("
Response.Write SQL(4,iii) '输出还有多少子集了
Response.Write ")"
end if
response.write "</td></tr>"
Next
response.write "</table>"
response.write "<br><br><br><br><br><br><br><br>"
%>
- ASP无级分类解决方案
- ASP+Js+Access 实现无级分类
- 无级分类
- Sql无级分类
- TreeView无级分类
- 无级别分类
- php实现树状结构无级分类
- php实现树状结构无级分类
- php实现树状结构无级分类
- (Adodb+Smarty)无级分类(无递归)+无级JS联动+树状显示+导航输出+批量移动
- ASP.net 2005 Treeview 无限分类非递归终极解决方案
- ASP.net 2005 Treeview 无限分类非地递归终极解决方案
- ASP.net 2005 Treeview 无限分类非地递归终极解决方案
- ASP.net 2005 Treeview 无限分类非地递归终极解决方案
- Treeview无限分类解决方案
- 新闻栏目分类解决方案
- jQuery无级右键菜单
- 不用递归无级树
- js 全选按钮 和 删除代码
- SQL Server 2005阻止了对组件 'xp_cmdshell' 的 过程'sys.xp_cmdshell' 的访问
- 让QWidget实现自动改变大小的方法
- C++思考笔记-----Ruminations on C++ 之 被封装的指针----句柄
- 移动行业EOMS系统
- ASP无级分类解决方案
- ajax 在updatepanel中使用alert提示方法
- C++ 再学习。。。编写高效安全的C++程序
- C#中的params关键字
- 牛人blog
- 存储引擎揭秘:基本结构之四——IAM页,IAM链和存储单元
- 使div浮动层显示在Select组件上面
- Windows的空指针赋值分区
- XML的基础和DOCTYPE字段的解析