当前位置: 移动技术网 > IT编程>开发语言>.net > 无需数据库循环的无级分类代码

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

2018年10月19日  | 移动技术网IT编程  | 我要评论

野菜部落官网,沂南电视台,敦煌种业招聘

<%@language="vbscript"%>
<!--表
if exists (select * from dbo.sysobjects where id = object_id(n[dbo].[cat]) and objectproperty(id, nisusertable) = 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.">îäµµ×êáï</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()
%>


如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网