Common Permissions

Permissions for objects are handled by working with the Permissions property of a Document object. This property is a Long value (also known as a Long Integer). Different permissions are assigned by setting or resetting specific bits or groups of bits of that long value. Therefore, the value of the Permissions property is typically set by combining predeclared constants using the Visual Basic bitwise operators And and Or. The following table describes the security constants and values that are predefined for all Microsoft Jet objects.

Constant Value Description
dbSecNoAccess &H0 To remove all permissions for an object from a user or group, set its Permissions property to dbSecNoAccess.
dbSecFullAccess &HFFFFF To grant all permissions to a given user or group for an object, set its Permissions property to dbSecFullAccess.
dbSecDelete &H10000 The permission to delete an object. For example, if a user has the dbSecDelete bit set on a Table object, the user can delete that table. Note that although you can set this permission on a Container object, it has no effect. Only Microsoft Jet can create and delete containers, and this is done on an internal level.
dbSecReadSec &H200000 The permission to read an object’s permissions settings. An owner of an object implicitly has this permission. If you do not have dbSecReadSec permission for an object and try to use DAO to do anything to the object’s Permission property, you receive an error.
dbSecWriteSec &H40000 The permission to alter an object’s permission settings. As with dbSecReadSec, the owner of the object implicitly has this permission, so you can’t orphan an object by revoking it.
dbSecWriteOwner &H80000 The permission to change the owner of an object. You do this by setting the Owner property of the appropriate Container or Document object.