国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

使用ASP實現網站的“目錄樹”管理的代碼

2024-05-04 11:01:12
字體:
來源:轉載
供稿:網友
使用ASP實現網站的目錄樹

數據庫結構(共使用了兩個表)
1。tblCategory
字段名  類型  
Root   binary   說明樹關或開(目錄的根)
ID     自動編號 關鍵字
Sort   integer  識別該字段內容的整數(如果root是開狀態(tài)sort為0)表示顯示的目錄的順序
Name   text(255)可以包含html中的標識符
HREF   text(255) 允許空

2。tblPages
ID   自動編號
Sort  integer 關鍵字
Name  text(255)
HREF  text(255)

3.default.htm
<html>
<head>
<title>javascript Tree Control Template</title>
</head>
<frameset cols=""210,*"">
?<frame src=""tree.asp"" name=""TOC"">
?<frame src=""main.htm"" name=""basefrm"">
</frameset>
</html>

4.main.htm
<head><title></title></head>
<body>
<h2>Start Page</h2>
</body>
</html>

5.tree.asp
Set conn = Server.CreateObject(""ADODB.Connection"")
Set Rs = Server.CreateObject(""ADODB.Recordset"")
conn.open ""DRIVER=Microsoft Access Driver (*.mdb);DBQ="" & Server.MapPath(""toc.mdb"")

strsql = ""SELECT tblCategory.Root, tblCategory.[ID], tblCategory.Sort AS CatSort, tblPages.sort AS LinkSort, tblCategory.[Name] AS CatName, tblCategory.HREF AS CatURL, tblPages.[Name] AS LinkName, tblPages.href AS LinkURL FROM tblCategory LEFT JOIN tblPages ON tblCategory.[ID] = tblPages.[ID] ORDER BY tblCategory.root ASC, tblCategory.Sort, tblPages.sort""

rs.open strsql, conn, 2, 2

if not rs.eof then rs.movefirst
currentID = """" %>
<html>
<head>
<link rel=""stylesheet"" href=""ftie4style.css"">
<!-- Infrastructure code for the tree -->
<script src=""ftiens4.js""></script>
<!-- Execution of the code that actually builds the specific tree -->
<script>
USETEXTLINKS = 1
<%
    Do While Not Rs.EOF
       If Rs(""Root"") = True Then %>
            foldersTree = gFld(""<%= Rs(""CatName"") %>"", ""<%= Rs(""CatURL"") %>"")
    <% Else %>
            aux1 = insFld(foldersTree, gFld(""<%= Rs(""CatName"") %>"", ""<%= Rs(""CatURL"") %>""))
    <% currentID = Rs(""ID"")
            savedID = Rs(""ID"")
            Do While currentID = savedID and not rs.eof
                if Rs(""LinkName"") <> """" Then %>
                    insDoc(aux1, gLnk(0, ""<%= Rs(""LinkName"") %>"", ""<%= Rs(""LinkURL"") %>""))

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 衡水市| 二连浩特市| 府谷县| 湘西| 呼和浩特市| 五莲县| 大足县| 定结县| 星子县| 尤溪县| 慈利县| 镇赉县| 平顶山市| 城市| 临城县| 句容市| 桓台县| 新龙县| 玉环县| 郑州市| 区。| 乐平市| 延川县| 崇阳县| 陈巴尔虎旗| 稻城县| 阿克苏市| 株洲县| 韶关市| 惠东县| 浦城县| 保康县| 防城港市| 温州市| 凤阳县| 旬邑县| 南通市| 张家界市| 和静县| 泰安市| 蒙城县|