AllPermissions, Permissions, and SystemDB Properties Example

This example uses the SystemDB, AllPermissions, and Permissions properties to show how users can have different levels of permissions depending on the permissions of the group to which they belong.

Sub AllPermissionsX()

   ' Ensure that the Microsoft Jet workgroup information 
   ' file is available.
   DBEngine.SystemDB = "system.mdw"

   Dim dbsNorthwind As Database
   Dim ctrLoop As Container

   Set dbsNorthwind = OpenDatabase("Northwind.mdb")

   ' Enumerate Containers collection and display the current 
   ' user and the permissions set for that user.
   For Each ctrLoop In dbsNorthwind.Containers
      With ctrLoop
         Debug.Print "Container: " & .Name
         Debug.Print "User: " & .UserName
         Debug.Print "  Permissions: " & .Permissions
         Debug.Print "  AllPermissions: " & _
            .AllPermissions
      End With
   Next ctrLoop

   dbsNorthwind.Close

End Sub