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

首頁 > 編程 > ASP > 正文

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

2020-07-27 13:05:55
字體:
來源:轉載
供稿:網友
使用ASP實現網站的目錄樹

數據庫結構(共使用了兩個表)
1。tblCategory
字段名  類型  
Root   binary   說明樹關或開(目錄的根)
ID     自動編號 關鍵字
Sort   integer  識別該字段內容的整數(如果root是開狀態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"") %>""))
                    <%
                end if
                Rs.MoveNext
                if not rs.eof then currentID = Rs(""ID"")
             Loop
         End If
        if currentID = """" then rs.movenext
    Loop %>
</script>
<script>
initializeDocument()
</script>
<base target=""basefrm"">
<title></title>
</head>
<body bgcolor=""white"">
</body>
</html>

 


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 冀州市| 荣成市| 托克逊县| 上思县| 洛川县| 和静县| 本溪| 乐业县| 安国市| 化德县| 武宁县| 旬邑县| 隆子县| 汉源县| 高密市| 吕梁市| 兰考县| 新野县| 昌乐县| 宜兰县| 江津市| 保德县| 九龙坡区| 贺兰县| 泗阳县| 镇平县| 德昌县| 墨脱县| 铁岭市| 左权县| 涿州市| 正镶白旗| 卢湾区| 冀州市| 项城市| 甘洛县| 自治县| 绥滨县| 咸丰县| 霞浦县| 渑池县|