Link to home
Start Free TrialLog in
Avatar of paulmcneil
paulmcneilFlag for United States of America

asked on

Groups and Users in an MDB outisde the currentdb

How do I enumerate the user names in an mdw file for a database external to the one I am currrently in?
ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
                    Next
                Next

End Sub
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