Microsoft KB Archive/223999

= BUG: Error 21770 Adding Login in SEM and User with SP_ADDUSER =

Article ID: 223999

Article Last Modified on 10/3/2003

-

APPLIES TO


 * Microsoft SQL Server 6.5 Standard Edition

-



This article was previously published under Q223999



SYMPTOMS
After you grant database access through sp_adduser to a login that was created using Enterprise Manager, the following error message (Error 21770) occurs when you edit the login in Enterprise Manager:

The name was not found in the Users collection.

If you delete the user from the database and then try to drop the login, the following error message might appear (Error 15175):

 Login 'user' is aliased or mapped to a user in one or more database(s). Drop user or alias before dropping login.



WORKAROUND
To work around this problem, do one of the following:
 * When you add the login in SQL Enterprise Manager, specify a default database and a permit database.
 * In Enterprise Manager, expand Servername/Databases/databasename/Groups/Users. Right-click Public and click refresh.



STATUS
Microsoft has confirmed this to be a problem in SQL Server 6.5.



Steps to Reproduce Behavior
 In the SQL Enterprise Manager, define a new login (for example, user1).  Open a query window, chose pubs as the database, and run the following code: sp_adduser user1, user1 SQL Server returns the following message: "New user added."  Go to Enterprise Manager, and refresh Logins. Double-click user1 login.

RESULT: The following error message appears:

Error 21770: The name 'user1' was not found in the Users collection.

You might also experience this error when you try to edit permissions for the user.

This error also occurs when adding a login through sp_addlogin.

Keywords: kberrmsg kbbug kbpending KB223999

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.