Sunday, February 19, 2012

allowing anyone into SQL Server 2000

I am using SQL Server 2000 (the in-a-single-PC server
that is primarily for server program development).
Therefore, I don't need to have a password with it. I
compiled my ASPX "database" (using ASP .NET Web Matrix)
and got this message in MS Explorer:
--
Cannot open database requested in login 'pubs'. Login
fails. Login failed for user 'DEMOPC-25\gbrown'.
Description: An unhandled exception occurred during the
execution of the current web request. Please review the
stack trace for more information about the error and
where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException:
Cannot open database requested in login 'pubs'. Login
fails. Login failed for user 'DEMOPC-25\gbrown'.
--
Could you tell me how to get around this login problem?
Thank you!Login to the server as 'sa'.
sp_grantlogin 'DEMOPC-25\gbrown'
go
Change databases to your database
use mydatabase
go
sp_grantdbaccess 'DEMOPC-25\gbrown'
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

No comments:

Post a Comment