Showing posts with label programs. Show all posts
Showing posts with label programs. Show all posts

Monday, March 12, 2012

how to add login user (ASPNET) to MS SQL 2000 Desktop Engine server (MSDE2000)?

How do I add login user ASPNET to my SQL 2000 Desktop Engine Server?. I can not find the "Server Manager" in the Start - Programs. Is there any other way to get around adding ASPNET login to the SQL server so I can test my VB program. I got the error: Login failed for user 'com_name\ASPNET'.Use OSQL, a command line tool. Find it, and from the command prompt:

osql -S servername\instancename -E -q
--Line numbers will appear
EXEC sp_grantlogin 'com_name\ASPNET'
go
use <databasename>
go
EXEC sp_grantdbaccess 'com_name\ASPNET'
go
EXEC sp_addrolemember 'db_owner', 'com_name\ASPNET'
go