ASP Is Fun

Learning ASP
Free Course
Basics
Functions
SQL Commands
Sample Code

Servers / Setup
Host Reviews
Server Setup
Error Tips

Contract ASP
Development

Intro to ASP



 


Connecting a Login to a Database User

When you restore a database onto a server, it restores the database's tables along with the users that own those tables. However, it does NOT create the actual logon accounts to log into the MS-SQL database with. If you then try to create a logon account and connect it to that database, the system will complain that the database user already exists!

Here's the solution. Let's say your database is called "MyDB". You would do:

USE MyDB

go

EXEC sp_change_users_login 'Update_One', 'USERNAME', 'LOGONNAME'

The Update_One is the actual letters for that field - it says to update the logon name. The USERNAME should be replaced with the username that owns the tables. The LOGONNAME should be replaced with the new logon name you have created.

ASP Server Setup Information


ASP Main Page | ASP Ebooks | Free ASP Course | Contact Lisa
All content copyright © 2008 Minerva WebWorks LLC. All rights reserved.



Free Newsletter!

Ebooks
Intro to ASP
ASP SQL DB
Members
Shopping


Introduction to ASP

Romance Tips
Irish Romance
Italian Romance
French Romance

ASP Poll
How do you handle 500 errors?
I don't
Page does nothing
Displays error
Emails error