TreeView控件在編制程序過程中用得比較多
看看下面一個實際的問題
數據庫:access
表:Test
字段:bh(班級編號
功能
測試數據
添加TreeView控件
可以仔細的看代碼
Dim nddata As Node
Dim cnn As ADODB
Dim rs
Dim rs
Private Sub Command
On Error Resume Next
Set nddata = TreeView
nddata
Dim intcount As Integer
Dim inttable As Integer
Dim intfield As Integer
Dim intfn As Integer
rs
inttable = rs
Do While inttable <> intcount
Set nddata = TreeView
rs
intfield = rs
If intfield <>
intfn =
Do While intfield <> intfn
Set nddata = TreeView
rs
intfn = intfn +
Loop
End If
rs
rs
intcount = intcount +
Loop
rs
End Sub
Private Sub Command
On Error Resume Next
Set nddata = TreeView
nddata
rs
Do While Not rs
If ca <> rs
Set nddata = TreeView
ca = rs
End If
Set nddata = TreeView
rs
Loop
rs
End Sub
Private Sub Form_Load()
Set cnn = New ADODB
cnn
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set con = Nothing
End Sub
From:http://tw.wingwit.com/Article/Network/201311/29939.html