Solved

Error 21770: Name not found in Users collection.

Posted on 1998-08-11
7
935 Views
Last Modified: 2008-02-01
When I add a login to SQL Server using the sp_addlogin
SP, and then go in through the Enterprise Manager to
add that login to a predefined group, I get the error
"Error 21770: The name 'VDnwid' was not found in Users
collection" I cannot add this login to a group.
What should I be doing here?
 
0
Comment
Question by:vd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 2

Expert Comment

by:connex
ID: 1089533
how exactly to you add the login? (give sp_addlogin line)
This worked fine for me till now

0
 

Author Comment

by:vd
ID: 1089534
Thanks. Here's the line:

isql /U sa /P %1 /S %2 /Q "sp_addlogin %3, %4, %5"

This is obviously executed in a .bat file.
%1 is the sa password; %2 is the server; %3 is the login to be
added; %4 is the password for this login; %5 is the default database for this new login.
0
 
LVL 2

Accepted Solution

by:
connex earned 50 total points
ID: 1089535
Ah thats it :)
You need to call sp_adduser as well.
The sp_addlogin just makes a new entry in the master database about a new login but does not assign it to a db.
just call for the database you want to give the user access

sp_adduser <login_id>[,<username>[,<groupname>]]



0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 

Author Comment

by:vd
ID: 1089536
Thankyou!
0
 

Author Comment

by:vd
ID: 1089537
I added the sp_adduser statement to my procedure (.bat file)
and I still get the same error!
0
 
LVL 2

Expert Comment

by:connex
ID: 1089538
So you do now:

use master
sp_addlogin test
go
use mydb
sp_adduser test
go

Yes?

0
 

Author Comment

by:vd
ID: 1089539
Thanks. That seems to work.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question