How records in the database are recursively added to the TREEVIEW__ database

Source: Internet
Author: User
Private Sub Startadd (TreeView TV)
 Dim s As String
 Dim root As Node

 ' Here you can first create a root node 
 set Root=tv.nodes.add ( ,, Key, "This is the root node")
 root.expand
 s= "Select *from tab where parentid= ' 0 '"
 ' for database query while
 (condition established)
  TV.NODES.AA (Root,tvchild,key,text)
  recurrencefun (tv,key)
  ' move to the next
 wend
End Sub

private Sub Recurrencefun (TreeView tv,node pnode,int Pid)
 Dim s As String 
 Dim node As Node

 s= "Select *from tab wher E parentid= ' + Pid + ' "
 ' for database query while
 (condition set)
  set Node=tv.nodes.aa (pnode,tvchild,key,text)
  Recurrencefun (TreeView tv,node,int Pid)
  ' moves to the next
 wend
End Sub

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.