|
![]() |
名片设计 CorelDRAW Illustrator AuotoCAD Painter 其他软件 Photoshop Fireworks Flash |
|
数据库结构(共使用了两个表) 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> 返回类别: 教程 上一教程: ASP进阶之文章在线治理更新(12) 下一教程: 用ASP自动生成SQL数据库的安装源程序 您可以阅读与"用ASP实现网站的“目录树”治理"相关的教程: · ASP+ACCESS实现的无限级目录树 · 使用ASP方便的建立自己网站的每日更新 · ASP检索网站指定目录文件的算法与应用方向 · 用ASP实现网页BBS · 使用XMLHTTP结合ASP,实现网页的异步调用 |
![]() ![]() |
快精灵印艺坊 版权所有 |
首页![]() ![]() ![]() ![]() ![]() ![]() ![]() |