0
的MS Access安全組怎麼能在我通過VBA我的應用程序找到所有的MS Access安全組的列表?我怎樣才能找到所有在VBA
我知道我可以通過轉到工具 - >安全 - >用戶和組帳戶,但我想通過VBA(我想自動執行一些用戶創建例程)。
我已經考慮增加分配給所有組的虛擬用戶,只是拉他們從用戶分配到組,但必須有這樣做一個更清潔的方式。
的MS Access安全組怎麼能在我通過VBA我的應用程序找到所有的MS Access安全組的列表?我怎樣才能找到所有在VBA
我知道我可以通過轉到工具 - >安全 - >用戶和組帳戶,但我想通過VBA(我想自動執行一些用戶創建例程)。
我已經考慮增加分配給所有組的虛擬用戶,只是拉他們從用戶分配到組,但必須有這樣做一個更清潔的方式。
找到了!
Dim curr_group As Group
Dim group_cnt As Long
Dim group_ndx As Long
Dim strGroup As String
Dim strGroupList As String
strGroupList = ""
group_cnt = DBEngine(0).Groups.Count
For group_ndx = 0 To group_cnt - 1
Set curr_group = DBEngine(0).Groups(group_ndx)
strGroup = curr_group.Name
If strGroupList = "" Then
strGroupList = strGroup
Else
strGroupList = strGroupList & ";" & strGroup
End If
Next group_ndx
Me.lbxSysGroups.RowSource = strGroupList
呃,是不是谷歌發佈您的問題之前? – 2010-12-03 21:11:35