Groups and Users in an MDB outisde the currentdb

Posted on 2005-04-29
Last Modified: 2013-12-05
How do I enumerate the user names in an mdw file for a database external to the one I am currrently in?
Question by:paulmcneil
    LVL 77

    Accepted Solution

    Hi paulmcneil,
    You can open any mdw file.  mdw files are not linked to a database file (except in our heads, where we associate one with another).
    An mdw file is just an Access database so you can open it in code and if you do queries based on Msysgrouplist and msysuserlist you can find the names (only) of all users and groups.
    LVL 17

    Expert Comment

    peter57r is right and here is a way to do it.  If you are signed in to the .mdw file you do this:

    Public Sub EnumerateUsr_Grps()
                    Set WrkSp = DBEngine.Workspaces(0)
                    For Each New_User In WrkSp.Users
                        'Debug.Print New_User.Name
                        For Each GroupMem In New_User.Groups
                            'Debug.Print "        " & GroupMem.Name

    End Sub
    LVL 17

    Expert Comment

    You can also use the same .mdw file for as many databases as you like.  Just login into any database as an administrator and join the workgroup.  In Access 2k3 it's Tools>Security>workgroup administrator

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    In the article entitled Working with Objects – Part 1 (, you learned the basics of working with objects, properties, methods, and events. In Work…
    Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now