Solved

Error 21770: Name not found in Users collection.

Posted on 1998-08-11
7
928 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
  • 4
  • 3
7 Comments
 
LVL 2

Expert Comment

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

0
 

Author Comment

by:vd
Comment Utility
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
Comment Utility
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:vd
Comment Utility
Thankyou!
0
 

Author Comment

by:vd
Comment Utility
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
Comment Utility
So you do now:

use master
sp_addlogin test
go
use mydb
sp_adduser test
go

Yes?

0
 

Author Comment

by:vd
Comment Utility
Thanks. That seems to work.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now