14109.html

来自「VB技巧问答10000例 VB技巧问答10000例」· HTML 代码 · 共 23 行

HTML
23
字号
<html>
  <head>
    <title>附上 Recursive 的程式码</title>
  </head>
  <body bgcolor="#FFFFFF" vlink="#808080">
    <center>
      <h1>附上 Recursive 的程式码</h1>
    </center>
<hr size=7 width=75%>

<hr size=7 width=75%><p>
Posted by <a href="mailto:sephiroth@optimasoft.com.tw">Sephiroth</a> on June 10, 1999 at 11:20:05:<p>
In Reply to: <a href="14103.html">如何找出某一 Node 的所有后代子孙?</a> posted by Sephiroth on June 10, 1999 at 10:32:08:<p>
Private Sub RecursiveFind(lngID As Long)<br>    <br>    Dim oRs As ADODB.Recordset<br>    Dim sTSQL As String<br>    Dim lIndex As Long, lCount As Long<br>    Dim lRet As Long<br>    <br>    Set oRs = New ADODB.Recordset<br>    <br>    sTSQL = "SELECT * FROM Relationship WHERE ID=" & lngID<br>    Set oRs = mobjCon.Execute(sTSQL)<br>    lCount = oRs.RecordCount<br>    <br>    If lCount Then<br>        For lIndex = 1 To lCount<br>            Debug.Print oRs("ID"), oRs("ChildID")<br>            RecursiveFind oRs("ChildID")<br>            oRs.MoveNext<br>        Next<br>    End If<br>    <br>End Sub<br>
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 14109-->
</ul><!--end: 14109-->
<br><hr size=7 width=75%><p>

</body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?