黑客集中营首页|黑客新闻|黑客文章|黑营动画|黑客软件|黑客论坛 |黑客商城 |黑营招聘
热门搜索:杀毒 安全工具 黑客集中营 安全 黑客
 您现在的位置: 黑客集中营 >> 技术中心 >> 网络编程 >> 正文
无需数据库循环的无级分类代码
作者:佚名    文章来源:不详    点击数:    更新时间:2008-6-14        
<%@LANGUAGE="VBSCRIPT"%>
<!--数据库表
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Cat]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Cat]
GO

CREATE TABLE [dbo].[Cat] (
[Cat_Id] [int] IDENTITY (1, 1) NOT NULL ,
[Cat_Name] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Cat_Parent] [int] NULL
) ON [PRIMARY]
GO
-->
<%
MM_v2boy_STRING = "Driver={Microsoft Access Driver (*.mdb)};DBQ=d:\v2boy.mdb"
Dim rsCat__MMColParam
rsCat__MMColParam = "1"
if (Request.QueryString("Cat_Parent") <> "") then rsCat__MMColParam = Request.QueryString("Cat_Parent")(1)
'response.write request.querystring & "<hr>" & rsCat__MMColParam
'response.end
%>
<%
set rsCat = Server.CreateObject("ADODB.Recordset")
rsCat.ActiveConnection = MM_v2boy_STRING
rsCat.Source = "SELECT Cat_Id, Cat_Name, Cat_Parent FROM Cat WHERE Cat_Parent = " + Replace(rsCat__MMColParam, "'", "''") + ""
rsCat.CursorType = 0
rsCat.CursorLocation = 2
rsCat.LockType = 3
rsCat.Open()
rsCat_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
rsCat_numRows = rsCat_numRows + Repeat1__numRows
%>
<html>
<head>
<title>Îĵµ×ÊÁÏ</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<%
dim request_all
IF request.querystring <> "" then request_all = "&" & request.querystring
%>
<table width="100%" border="0" cellspacing="1" cellpadding="4">
<tr>
<td><a href="data.asp">Îĵµ×ÊÁÏ</a>
<%
dim i,j,h
j = Request.QueryString("Cat_Parent").Count
For i = 1 to j
'For i = j to 1 step -1
response.write "<a href=data.asp?"
for h = (j - i + 1) to j
'for h = j to (j - i + 1) step -1
Response.Write "Cat_Parent=" & Request.QueryString("Cat_Parent")(h) & "&Cat_Name=" & Request.QueryString("Cat_Name")(h)
if h <> j then
response.write("&")
end if
Next
'response.write "<br>"
response.write ">" & Request.QueryString("Cat_Name")(j-i+1) & "</a> "
Next

response.write "<br>"

While ((Repeat1__numRows <> 0) AND (NOT rsCat.EOF))
%>
<% If Not rsCat.EOF Or Not rsCat.BOF Then %>
<a href="data.asp?Cat_Parent=<%=(rsCat.Fields.Item("Cat_Id").Value)%>&Cat_Name=<%=(rsCat.Fields.Item("Cat_Name").Value)%><%=request_all%>"><%=(rsCat.Fields.Item("Cat_Name").Value)%></a>
<% End If ' end Not rsCat.EOF Or NOT rsCat.BOF %>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsCat.MoveNext()
Wend
%>
</td>
</tr>
</table>
</body>
</html>
<%
rsCat.Close()
%>


『关闭该页』 『打印该页』

  • 上一篇文章:
  • 责任编辑:封情
  • 下一篇文章:
  • 热门文章
    普通文章Windows 2K 微软最成功
    普通文章企业防病毒策略如何做
    普通文章网络安全特警2005评测
    普通文章网吧生存手册:10秒钟
    普通文章资深Linux程序员的开发
    普通文章用组策略限制软件使用
    普通文章浅谈网络监控软件的部
    普通文章入侵检测及网络安全发
    普通文章谈谈针对Linux的病毒起
    普通文章普遍存在的在线安全四
    相关文章
    WSH 直接将查询数据结果
    断开的数据库连接的一个
    一个防止外部数据提交的
    ADO连接数据库字符串大全
    如何正确显示数据库中的
    在.NET Framework中轻松
    在.NET Framework中轻松
    在.NET Framework中轻松
    在.NET Framework中轻松
    在.NET Framework中轻松
    在.NET Framework中轻松
    在.NET Framework中轻松
    在.NET Framework中轻松
    在.NET Framework中轻松
    在.NET Framework中轻松
    在.NET Framework中轻松
    在.NET Framework中轻松
    在.NET Framework中轻松
    教您使用XML封装数据库操
    PHP中对数据库操作的封装
    关于我们 | 加入会员| 投稿方法 | 友情连接 | 网站地图 | 黑营论坛 | 黑营招聘
    加入会员咨询QQ:66647470 合作QQ:197430910 投稿:66647470 mail:85soft#163.com(#改@)
    版权:2003-2008HACK52.COM 集中营宣言普及黑客安全意识!打造顶尖黑客安全资讯网!
    浙ICP备06050453号