当前位置: 首页 > 图文教程 > 网络编程 > ASP > 用排序串字段实现树状结构(例程:显示树)

ASP
Asp+Sql 对数据库的各种操作
ASP:6行代码实现无组件上传
ASP中几种分页显示的比较
ASP中数据库调用中常见错误的现象和解决
ASP实用技巧:强制刷新和判断文件地址
asp全站防止注入的代码
ASP如何获取客户端真实IP地址
ASP实现可显示和隐藏的树型菜单
如何用ASP获取真实IP地址
ASP与SQL数据库连接代码
拒绝攻击 万能Asp防注入代码
草根站长成长计划:跟我学新云采集入门(2)
ASP技巧:提高使用Request集合的效率
Asp用存储过程实现数据分页
做网页时常用的ASP函数
Asp编码优化技巧八则
ASP中Cache技术的应用
用ASP封IP的方法,防止固定IP垃圾留言
ASP实现一行多列显示方法实例程序
ASP实现动态添加表单内容的实例程序

ASP 中的 用排序串字段实现树状结构(例程:显示树)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 24 ::
收藏到网摘: n/a

  程序index.asp
功能:显示目录树

<!-- #include file="lybcon.inc" --><%
pageno=request("pageno")
searchtype=request("searchtype")
searchnr=rtrim(request("searchnr"))
set guestconn=Server.CreateObject("ADODB.connection")
guestconn.Open lybstr
set guestrs=server.createobject("ADODB.recordset")
sqlstr="SELECT * FROM guestbook"
if searchnr<>"" then sqlstr=sqlstr&" where "&searchtype&" like '%%"&replace(searchnr,"'","''")&"%%'"
sqlstr=sqlstr&" order by rootid+(1-sign(rootid))*lybid desc,orderstr,lybid desc"
guestrs.open sqlstr,guestconn,1,1
rowcount=25
if pageno="" then pageno=1
if not guestrs.eof then
  if IsNumeric(pageno) then
    guestrs.pagesize=rowcount
    if pageno+1>guestrs.pagecount+1 then pageno=guestrs.pagecount
  else
    pageno=1
  end if
  guestrs.AbsolutePage=pageno
else
  pageno=1
end if
%><html>
<head><title>软件使用留言薄</title>
<style TYPE="text/css">
<!--
a {  text-decoration: none}
body {line-height:18px;font-size:9pt;font-family:宋体}
a:hover {color:#FF0000;text-decoration:none}
.submit {line-height:9pt;font-size:9pt;font-family:宋体}
.submit1 {line-height:8pt;font-size:8pt;font-family:宋体}
.selectform {font-family: 宋体; font-size: 9pt;background-color:ffE4E4}
td {font-family: 宋体; font-size: 9pt;background-color:ECF7FF}
.td1 {font-family: 宋体; font-size: 9pt;background-color:A2C8F2}
.td2 {font-family: 宋体; font-size: 9pt;background-color:E9EDE0}
.small1 {font-family: 宋体; font-size: 9pt;background-color:ffffff;line-height:9pt}
-->
</style>
<script language="JavaScript1.2">
function d(sp,t,a,d,ti,l,id,rid,pn)
{
document.write("<tr><td>"+sp+"<a href='disprec.asp?
keyid="+id+"&rootid="+rid+"&pageno="+pn+"'>"+t+"</a></td>");
document.write("<td align=right>"+a+" </td>");
document.write("<td nowrap align=center>"+d+" "+ti+"</td>");
document.write("<td align=right>"+l+" </td>");
document.write("<td align=right>"+id+" </td>");
document.write("</tr>");
}
</script>
</head>
<body topmargin=16>
<form name='index' method='POST' action='index.asp'>
<table width=100% align=center>
  <tr>
   <td align=center style='font-size:16px;background-color:ffffff;color:red' height=35 valign=top>软件使用
留言薄</td>
   <td align=center colspan=3 style='font-size:13px;background-color:ffffff' valign='bottom'>共<font
style='font-size:16px;color:red'><% =guestrs.recordcount %></font>条留言<font style='font-
size:16px;color:red'><% =guestrs.pagecount %></font>页目前第<font style='font-size:16px;color:red'><%
=pageno %></font>页</td>
   <td style='background-color:ffffff' valign=bottom><a href="/wen/swuselyb/index.asp">旧留言薄
</a></td></tr>
  <tr>
   <td class='td2' align='center'>搜索贴子
    <select name='searchtype' class='small1'>
     <option value='guestname' <% if searchtype="guestname" then response.write("selected") %>>贴子作者
</opion>
     <option value='guestcomm' <% if searchtype="guestcomm" then