|
中文字段有点邪门
Dim Rec As New ADODB.Recordset
Dim stRecQL As String
Dim Item As Integer
Dim i As Integer
Dim nodindex As Node
Rec.Open ("select distinct 一级菜单 from 一级菜单"), CurrentProject.Connection, adOpenKeyset, adLockOptimistic, adCmdTableDirect
For i = 0 To Rec.RecordCount - 1
Set nodindex = TreeView.Nodes.Add(, , Rec.Fields("一级菜单"), Rec.Fields("一级菜单"), "z1", "z2")
nodindex.Sorted = True
Rec.MoveNext
Next
Rec.Close
Rec.Open "一级菜单", CurrentProject.Connection, adOpenKeyset, adLockOptimistic, adCmdTableDirect
Do While Not Rec.EOF
A = Rec.Fields("一级菜单")
Set nodindex = TreeView.Nodes.Add(A, tvwChild, Rec.Fields("二级菜单"), Rec.Fields("二级菜单"), "z1", "z2")
nodindex.Sorted = True
Rec.MoveNext
Loop
Rec.Close |
|