SQL Admin Provider::RevokeDBAccess

The RevokeDBAccess method allows you to revoke the access of a SQL account for a particular database on a Windows NT or Windows 2000 server. This removes the user to the public role for that database. This is separate from the RemoveUserfromRole method as it does not reliably affect the public role. The user must already have been granted access to the SQL server by means of AddLogin or GrantLogin.

Arguments

Input argument Required Description

Name

Yes

Is the security account being denied access to the database. The value for security_account is SYSNAME, with no default. The security_account can be any valid SQL Server user, SQL Server role, or any Microsoft Windows NT user or group granted access to the current database. When adding Windows NT users or groups, specify the name that the Windows NT user or group is known by in the database.

Database

Yes

The database the user should no longer have access to.

ServerName

Yes

A string representing the name of the server. This can be a NetBIOS name, a FQDN, or an IP address. It is vital that the server upon which MPS is running be able to resolve server names using whichever naming convention you employ.

[sqlUserName]

No

The user name for connecting to the SQL server via SQL Authentication. If this node is present the connection will be made via SQL Authentication rather than Windows Authentication. The existence of this node also requires that the <sqlUserPass/> node exist.

[sqlUserPass]

No

The password for connecting to the SQL server via SQL Authentication using the username indicated by <sqlUserName/>. If the <sqlUserName/> node is not present, this node is ignored.

Remarks

Rollback Calls

The RevokeDBAccess method has no transaction rollback support.

Sample Code

Example XML Request

The following is an example of an XML request for the RevokeDBAccess method:

<?xml version="1.0" encoding="iso-8859-1" ?>  
<request> 
    <data> 
        <name>SampleSQL01_User</name> 
        <database>SampleSQL01</database> 
        <serverName>SQL01</serverName> 
        <sqlUserName>sampleUser</sqlUserName> 
        <sqlUserPass>Pass1Word</sqlUserPass> 
    </data> 
    <procedure> 
        <execute namespace="SQL Admin Provider"  
         procedure="RevokeDBAccess"> 
        <before source="data" destination="executeData" mode="merge"/> 
        <before source="executeData" destination="data" mode="insert"/> 
        </execute> 
    </procedure> 
</request> 

Example XML Response

The following is an example of the structure of an XML response for the RevokeDBAccess method. The actual returned data will be filled in within the <data> nodes:

<?xml version="1.0" encoding="iso-8859-1" ?>  
<response> 
    <data></data> 
</response> 

Applies To

for:

  • Hosted Messaging and Collaboration version 4.5

  • Hosted Messaging and Collaboration version 4.0

  • Hosted Messaging and Collaboration version 3.5

  • Hosted Messaging and Collaboration version 3.0

  • Windows-based Hosting version 4.5

  • Windows-based Hosting version 4.0

  • Windows-based Hosting version 3.5

  • Windows-based Hosting for Applications version 1.0

See also

Tasks

SQL Admin Provider::GrantDBAccess