<%@language="vbscript"%><br>
<!–数据库表<br>
if exists (select * from dbo.sysobjects where id = object_id(n[dbo].[cat]) and objectproperty(id, nisusertable) = 1)<br>
drop table [dbo].[cat]<br>
go<br>
<br>
create table [dbo].[cat] (<br>
[cat_id] [int] identity (1, 1) not null ,<br>
[cat_name] [nvarchar] (50) collate chinese_prc_ci_as null ,<br>
[cat_parent] [int] null <br>
) on [primary]<br>
go<br>
–><br>
<%<br>
mm_v2boy_string = "driver={microsoft access driver (*.mdb)};dbq=d:\v2boy.mdb"<br>
dim rscat__mmcolparam<br>
rscat__mmcolparam = "1"<br>
if (request.querystring("cat_parent") <> "") then rscat__mmcolparam = request.querystring("cat_parent")(1) <br>
response.write request.querystring & "<hr>" & rscat__mmcolparam<br>
response.end<br>
%><br>
<%<br>
set rscat = server.createobject("adodb.recordset")<br>
rscat.activeconnection = mm_v2boy_string<br>
rscat.source = "select cat_id, cat_name, cat_parent from cat where cat_parent = " + replace(rscat__mmcolparam, "", "") + ""<br>
rscat.cursortype = 0<br>
rscat.cursorlocation = 2<br>
rscat.locktype = 3<br>
rscat.open()<br>
rscat_numrows = 0<br>
%><br>
<%<br>
dim repeat1__numrows<br>
repeat1__numrows = -1<br>
dim repeat1__index<br>
repeat1__index = 0<br>
rscat_numrows = rscat_numrows + repeat1__numrows<br>
%><br>
<html><br>
<head><br>
<title>îäµµ×êáï</title><br>
<meta http-equiv="content-type" content="text/html; charset=gb2312"><br>
</head><br>
<body bgcolor="#ffffff" text="#000000"><br>
<%<br>
dim request_all<br>
if request.querystring <> "" then request_all = "&" & request.querystring<br>
%><br>
<table width="100%" border="0" cellspacing="1" cellpadding="4"><br>
<tr> <br>
<td><a href="data.asp">îäµµ×êáï</a><br>
<% <br>
dim i,j,h<br>
j = request.querystring("cat_parent").count<br>
for i = 1 to j<br>
for i = j to 1 step -1<br>
response.write "<a href=data.asp?"<br>
for h = (j – i + 1) to j<br>
for h = j to (j – i + 1) step -1<br>
response.write "cat_parent=" & request.querystring("cat_parent")(h) & "&cat_name=" & request.querystring("cat_name")(h)<br>
if h <> j then<br>
response.write("&")<br>
end if<br>
next<br>
response.write "<br>"<br>
response.write ">" & request.querystring("cat_name")(j-i+1) & "</a> "<br>
next<br>
<br>
response.write "<br>"<br>
<br>
while ((repeat1__numrows <> 0) and (not rscat.eof)) <br>
%><br>
<% if not rscat.eof or not rscat.bof then %><br>
<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> <br>
<% end if end not rscat.eof or not rscat.bof %><br>
<% <br>
repeat1__index=repeat1__index+1<br>
repeat1__numrows=repeat1__numrows-1<br>
rscat.movenext()<br>
wend<br>
%><br>
</td><br>
</tr><br>
</table><br>
</body><br>
</html><br>
<%<br>
rscat.close()<br>
%><br>
无需数据库循环的无级分类代码
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 无需数据库循环的无级分类代码
相关推荐
-      DataGrid中的按钮反选事件与NamingContainer(命名容器)-downmoon-ASP教程,数据库相关
-      根据数据表中数据,生成Powerpoint幻灯片-ASP教程,数据库相关
-      使用用VB处理MYSQL数据库中二进制数据问题-.NET教程,VB.Net语言
-      关于DataGridView中如何接收处于编辑状态下的当前信息-ASP教程,数据库相关
-      ActiveMQ4.1+Spring2.0的POJO JMS方案(上)-.NET教程,数据库应用
-      ASP.NET 2.0中直接将Access数据库导入到Excel文件中-.NET教程,Asp.Net开发
-      DataGrid的多行提交-.NET教程,数据库应用
-      一个简单的asp数据库操作类-ASP教程,数据库相关
