window| Menu | recursion <HTML>
<HEAD>
<meta content= "text/html; charset=gb2312 "http-equiv=content-type>
<script lanuage= "JScript" >
function Turnit (SS,II,AA)
{
if (ss.style.display== "None")
{ss.style.display= "";
Aa.style.display= "";
ii.src=http://www.163design.net/a/q/"Minus.gif";
}
Else
{ss.style.display= "none";
Aa.style.display= "None";
ii.src=http://www.163design.net/a/q/"Plus.gif";}
}
function Onlyclose (SS,II,AA)
{
Ss.style.display= "None";
Aa.style.display= "None";
ii.src=http://www.163design.net/a/q/"Plus.gif";
}
</SCRIPT>
</HEAD>
<body bgcolor= #99CCFF >
<%
Dim dbconn
Dim Idindex
Idindex = 0
' Establish a database connection
Set dbconn = Server.CreateObject ("Adodb.connection")
Dbconn.open "Driver={microsoft Access DRIVER (*.mdb)}; Dbq= "& Server.MapPath (" Test.mdb ")
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Generate recursive function of file type tree, passed in parameter: Nowitem as tree Node ID '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub Doitem (Nowitem)
Dim rstest
Dim Youngerbrother ' ID of the next sibling node
Dim Olderson ' The ID of the first word node
' Set up a recordset
Set rstest = Server.CreateObject ("Adodb.recordset")
' Generate SQL statements, manipulate doc_typetree tables
strSQL = "SELECT * from tab_test where ID = '" & Nowitem & "'"
' Generate a Recordset
Rstest.open strsql,dbconn,1,3
If Rstest.eof Then
Rstest.close
Set Recdostype = Nothing
Exit Sub
End If
Youngerbrother = Trim (Rstest ("Brothernode") & "")
Olderson = Trim (Rstest ("Sonnode") & "")
NodeID = Trim (Rstest ("ID") & "")
NodeName = Trim (Rstest ("NodeName") & "")
' Show child nodes
If Olderson = "" or Olderson = "then" When this item has no subkeys, output the corresponding code
Response.Write "<TR>" & Chr (10)
Response.Write "<TD> </TD>" & Chr (10)
Response.Write "<TD>"
Response.Write "<a href= ' Test ' >" & nodename & "</A>"
Response.Write "</TD>" & Chr (10)
Response.Write "</TR>" & C