Wrox Programmer Forums
|
SQL Server ASP Discussions about ASP programming with Microsoft's SQL Server. For more ASP forums, see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 22nd, 2003, 03:22 PM
Registered User
 
Join Date: Dec 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Server error

Hello!
I received the following message with I tried connecting to my database using my browser. Could someone please, give me some suggestions.
Thanks,
Anthony

Server Error in '/BegASPNETdb' Application.
--------------------------------------------------------------------------------

Login failed for user 'TOSHIBA-USER\ASPNET'.
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: Login failed for user 'TOSHIBA-USER\ASPNET'.

Source Error:


Line 31: Dim objCommand As New SqlCommand(strSQL, objConnection)
Line 32:
Line 33: objConnection.Open()
Line 34:
Line 35: Response.Write("ServerVersion: " & objConnection.ServerVersion & _


Source File: C:\BegASPNETdb\webroot\ch03\SQLServer_connection.a spx Line: 33

Stack Trace:


[SqlException: Login failed for user 'TOSHIBA-USER\ASPNET'.]
   System.Data.SqlClient.SqlConnection.Open() +761
   ASP.SQLServer_connection_aspx.Page_Load(Object Source, EventArgs E) in C:\BegASPNETdb\webroot\ch03\SQLServer_connection.a spx:33
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +29
   System.Web.UI.Page.ProcessRequestMain() +724

 
Old December 23rd, 2003, 04:51 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Sounds like the identity you're trying to connect with doesn't have access to the database. Try running this code in Query Analyser:
Code:
USE Master
GO
-- this line allows connection to the server
EXEC sp_grantlogin 'TOSHIBA-USER\ASPNET'
GO

-- This line grants access to a specific database
USE <<YourDbName,e.g.Northwind>> -- CHANGE THIS
GO
EXEC sp_grantdbaccess 'TOSHIBA-USER\ASPNET', 'ASPNET'
GO
 
Old September 4th, 2006, 01:07 PM
Registered User
 
Join Date: Sep 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Phil, would you kindly take a look at my similar post? I'm not ready to run your code in the Query Analyzer because I'm not sure I'm using the right values for my connection string. Thank you. http://p2p.wrox.com/topic.asp?TOPIC_ID=49230






Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Server Reg. SQL Server does not exist error Arsi SQL Server 2000 1 June 11th, 2008 11:20 AM
What is the error message for a 500 server error? chobo2 C# 2005 1 May 4th, 2008 03:11 AM
Error 500 -- Internal Server Error Vijay Kumar Servlets 2 March 26th, 2007 02:10 AM
server error when uploading to remote server ammweb ASP.NET 1.0 and 1.1 Basics 7 July 30th, 2006 01:51 AM
Error in Server when submitting this to the server zach2004 Classic ASP XML 0 March 8th, 2004 03:44 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.