无需数据库循环的无级分类代码

zhangziw8899

zhangziw8899

2016-01-29 20:16

无需数据库循环的无级分类代码,无需数据库循环的无级分类代码
<%@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

(本文来源于图老师网站,更多请访问http://m.tulaoshi.com/asp/)

response.write "<br"

(本文来源于图老师网站,更多请访问http://m.tulaoshi.com/asp/)

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()
%

展开更多 50%)
分享

猜你喜欢

无需数据库循环的无级分类代码

ASP
无需数据库循环的无级分类代码

ASP数据库恢复的代码

ASP
ASP数据库恢复的代码

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

用MySQL创建数据库和数据库表代码

编程语言 网络编程
用MySQL创建数据库和数据库表代码

Hibernate通用数据库操作代码

Web开发
Hibernate通用数据库操作代码

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

数据库分页存储过程代码

编程语言 网络编程
数据库分页存储过程代码

oracle 9i 数据库服务的分类

编程语言 网络编程
oracle 9i 数据库服务的分类

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

看人家用使用InstallShield制作ASP安装程序(1)

看人家用使用InstallShield制作ASP安装程序(1)

Photoshop鼠绘教程:结合数位板绘制中国城池插画

Photoshop鼠绘教程:结合数位板绘制中国城池插画
下拉加载更多内容 ↓