Share via


SPUsageDatabase.GrantAccess method (String, String)

Grants the specified user or group access to the database and adds them to the specified sql server role.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Sub GrantAccess ( _
    account As String, _
    role As String _
)
'Usage
Dim instance As SPUsageDatabase
Dim account As String
Dim role As String

instance.GrantAccess(account, role)
public void GrantAccess(
    string account,
    string role
)

Parameters

  • role
    Type: System.String

    The sql role in which the user should be added. If the role doesn't exist, it will be created.

See also

Reference

SPUsageDatabase class

SPUsageDatabase members

GrantAccess overload

Microsoft.SharePoint.Administration namespace