如何在 VBA 中找到所有 MS Access 安全组

发布于 2024-10-05 22:25:59 字数 192 浏览 3 评论 0原文

如何通过 VBA 找到应用程序中所有 MS Access 安全组的列表?

我知道我可以通过转到“工具”->“安全”->“用户和组帐户”来完成此操作,但我想通过 VBA 来完成此操作(我想自动执行一些用户创建例程)。

我考虑过添加一个分配给所有组的虚拟用户,然后从用户中提取分配给他们的组,但必须有一种更简洁的方法来做到这一点。

How can I find a list of all the MS Access security groups in my application through VBA?

I know I can do it by going to Tools->Security->User and Group accounts, but I'd like to do it through VBA (I'd like to automate some of my user creation routine).

I've considered adding a dummy user that is assigned to all the groups and just pulling the groups they are assigned to from the user, but there must be a cleaner way to do this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

∞琼窗梦回ˉ 2024-10-12 22:25:59

找到了!

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

Found it!

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文