Function MenuAkses()
Dim obj As Object
Dim xList As ListView
Dim rs As New MYSQL_RS
Dim xMenuMaster(9999) As String
Dim xMenuSet(9999) As String
Dim xMenuMain(9999) As String
Dim i As Integer
Dim j As Integer
rs.OpenRs "SELECT menu_set, menu_kode FROM kode_menu " & _
"WHERE menu_group = '" & xLevel & "' ORDER BY menu_id ASC", db
If rs.EOF = False Then
rs.MoveFirst
For i = 1 To rs.RecordCount
xMenuMaster(i) = rs.Fields("menu_kode")
xMenuSet(i) = rs.Fields("menu_set")
For Each obj In frmMain.Controls
If Left(obj.Name, 2) = "mn" Then
On Error Resume Next
If obj.Name = xMenuMaster(i) And xMenuSet(i) = "1" Then obj.Visible = True
If obj.Name = xMenuMaster(i) And xMenuSet(i) = "0" Then obj.Visible = False
End If
Next
rs.MoveNext
Next
End If
rs.CloseRecordset
End Function
Looping Menu Item di VB6 dari Mysql sesuai dengan level groupnya
Langganan:
Posting Komentar (Atom)
0 comments:
Posting Komentar