SQL Admin Provider::GrantDBAccess

The GrantDBAccess method allows you to grant access to a SQL account for a particular database on a Microsoft Windows NT or Microsoft Windows 2000 server. This adds the user to the public role for that database. This is separate from the AddUserToRole and RemoveUserfromRole methods, because they do not reliably affect the public role. If the user is a SQL user account, the user must already have been granted access to the SQL server by means of AddLogin. If the user account is a Windows NT or Windows 2000 account, it is not required to call GrantLogin prior to issuing this call.

 Sample Code
 Applies To
 See Also