USERS and GROUPS via SQL for MS Access databases

  • Thread starter Thread starter Steffen Rzonsa
  • Start date Start date
S

Steffen Rzonsa

How I can get via SQL the USERS and GROUPS and then membership (user is a
meber from a group) for MS Access databases?

Best regards

Steffen
 
Steffen Rzonsa said:
How I can get via SQL the USERS and GROUPS and then membership (user is a
meber from a group) for MS Access databases?

Will this help?

Sub CheckUser()
' Display the user name and the groups the user belongs to

Dim ws As DAO.Workspace
Dim db As DAO.Database

Set ws = DBEngine.Workspaces(0)
Set db = CurrentDb

Debug.Print ws.Groups.Count & " Groups "
Dim X As Integer
Dim Y As Integer
For X = 0 To ws.Groups.Count - 1
For Y = 0 To ws.Users.Count - 1
If ws.Users(Y).Name = CurrentUser() Then
Debug.Print " - " & ws.Users(Y).Name & "." &
ws.Groups(X).Name
End If
Next Y
Next X

End Sub
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top