7,763
社区成员
发帖
与我相关
我的任务
分享
Public Function GetModuleList() As Collection
Dim mycollection As New Collection
Call GetSubModuleList(0, mycollection, 1)
Return mycollection
End Function
Private Sub GetSubModuleList(ByVal m_upid As Integer, ByRef mycoll As Collection, ByVal m_deepth As Integer)
Dim strsql As String
strsql = "select m_id,m_name,m_url,m_upid,m_index from System_ModuleList where m_upid=" & m_upid & " order by m_index asc,m_id asc"
Try
Dim ds As DataSet
ds = mydbcontrol.SQLExecute_DataSet(strsql)
If Not IsNothing(ds) Then
For xx As Integer = 0 To ds.Tables(0).Rows.Count - 1
Dim mymodule As New modulelist
With mymodule
.m_id = ds.Tables(0).Rows(xx).Item("m_id")
.m_index = ds.Tables(0).Rows(xx).Item("m_index")
.m_name = ds.Tables(0).Rows(xx).Item("m_name")
.m_upid = ds.Tables(0).Rows(xx).Item("m_upid")
.m_url = ds.Tables(0).Rows(xx).Item("m_url")
.m_lid = m_deepth
End With
mycoll.Add(mymodule, "n" & mymodule.m_id)
mymodule = Nothing
Call GetSubModuleList(ds.Tables(0).Rows(xx).Item("m_id"), mycoll, m_deepth + 1)
Next
End If
ds.Dispose()
Catch ex As Exception
End Try
End Sub