ASP Is Fun

Learning ASP
Free ASP Course
ASP Basics
ASP Functions
SQL Commands
Sample ASP Code


Servers / Setup
ASP Host Reviews
ASP Server Setup
ASP Error Tips


Contract ASP
ASP Development

Search For:


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



Bookmark this site so you can reference it any time you have ASP questions in the future!

Add ASP+Is+Fun+Website+ to Twitter Add ASP+Is+Fun+Website+ to Facebook Add ASP+Is+Fun+Website+ to MySpace Add ASP+Is+Fun+Website+ to Del.icio.us Digg ASP+Is+Fun+Website+ Add ASP+Is+Fun+Website+ to Yahoo My Web Add ASP+Is+Fun+Website+ to Google Bookmarks Add ASP+Is+Fun+Website+ to Stumbleupon Add ASP+Is+Fun+Website+ to Reddit



 


Get Emails when this Site is Updated



ASP Ebooks | Free ASP Course |
All content copyright © 2013 Minerva WebWorks LLC. All rights reserved.

Exploring Believability

Free Newsletter!

Ebooks
Intro to ASP
ASP SQL DB
ASP Members
ASP Shopping


Introduction to ASP

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



affiliate_link