Skip to content

Latest commit

 

History

History
66 lines (52 loc) · 2.9 KB

File metadata and controls

66 lines (52 loc) · 2.9 KB
title SetPermissions Method (ADOX) | Microsoft Docs
ms.prod sql
ms.prod_service connectivity
ms.technology connectivity
ms.custom
ms.date 01/19/2017
ms.reviewer
ms.topic conceptual
apitype COM
f1_keywords
User25::SetPermissions
User25::raw_SetPermissions
_Group25::SetPermissions
_Group25::raw_SetPermissions
helpviewer_keywords
SetPermissions method [ADOX]
ms.assetid b7f925d7-b05c-4376-bb49-f8d2c17b8b24
author MightyPen
ms.author genemi

SetPermissions Method (ADOX)

Specifies the permissions for a group or user on an object.

Syntax

  
GroupOrUser.SetPermissions Name, ObjectType, Action, Rights [, Inherit] [, ObjectTypeId]  

Parameters

Name
A String value that specifies the name of the object for which to set permissions.

ObjectType
A Long value which can be one of the ObjectTypeEnum constants, that specifies the type of the object for which to get permissions.

Action
A Long value which can be one of the ActionEnum constants that specifies the type of action to perform when setting permissions.

Rights
A Long value which can be a bitmask of one or more of the RightsEnum constants, that indicates the rights to set.

Inherit
Optional. A Long value which can be one of the InheritTypeEnum constants, that specifies how objects will inherit these permissions. The default value is adInheritNone.

ObjectTypeId
Optional. A Variant value that specifies the GUID for a provider object type that is not defined by the OLE DB specification. This parameter is required if ObjectType is set to adPermObjProviderSpecific; otherwise, it is not used.

Remarks

An error will occur if the provider does not support setting access rights for groups or users.

Note

When calling SetPermissions, setting Actions to adAccessRevoke overrides any settings of the Rights parameter. Do not set Actions to adAccessRevoke if you want the rights specified in the Rights parameter to take effect.

Applies To

Group Object (ADOX) User Object (ADOX)

See Also

GetPermissions and SetPermissions Methods Example (VB)
GetPermissions Method (ADOX)
Name Property (ADOX)