USERS and GROUPS via SQL for MS Access databases

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
 
A

Arvin Meyer

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top