August 5, 2017 at 8:55 pm
I am just getting started with SQL so have no idea where to start with this error.It happens when trying to view a page on a website with a sql database behind it.
can anyone please help? see error below thank you
Server Error in '/' Application.
________________________________________
Login failed for user 'RESPONDER/administrator'.
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 'RESPONDER/administrator'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): Login failed for user 'RESPONDER/administrator'.]
databaseQueries.selectQueryNew(SqlCommand cmd) +185
viewProperties.refresh() +94
viewProperties.Page_Load(Object sender, EventArgs e) +28
System.Web.UI.Control.OnLoad(EventArgs e) +103
System.Web.UI.Control.LoadRecursive() +68
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3811
________________________________________
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2053.0
August 6, 2017 at 4:44 am
It's a login failure
Login failed for user 'RESPONDER/administrator
For some reason, the login doesn't have access to the DB. Speak to your DBA to help you with the details. There's a bunch of possible reasons and they're not visible from the front end.
Also, you should NEVER run a web page as a domain or machine administrator account. It is a major security risk. Application should be connecting as an application account, with minimal permissions and no administrative rights.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
August 9, 2017 at 8:05 pm
thanks for the reply, we dont have a DBA.
can you point me to a link that might show me how to set up the SQL server\database to allow a user with minimum rights access from the asp website?
thanks again
August 9, 2017 at 8:34 pm
P.S I am using SQL 2016 with Managment Studio
August 10, 2017 at 2:02 am
marcm22 - Wednesday, August 9, 2017 8:05 PMthanks for the reply, we dont have a DBA.
can you point me to a link that might show me how to set up the SQL server\database to allow a user with minimum rights access from the asp website?thanks again
What does "minimal" entail? SELECT, UPDATE, DELETE? Does it need execute permissions on any SPs (perhaps on a specific schema)? Does it need to be able to make DDL changes (I assume not as it's a website)? Different people, or companies, can have different ideas on what minimal means, but generally it means that the account can only do when it needs to, but you're the only one that knows what it should and shouldn't do. This means that even given an account SELECT on an entire schema might be frowned on, if there is one table that it doesn't need access to.
You can give a User or Role permissions at a database level using the GRANT, or add a User to a Role use ALTER ROLE. If you want to use a GUI then right click the user/User in the database and click Properties. You can assign permissions to objects in the Securables Pane, or you can add a user to a Database Role in the Membership Pane in the User Properties Window and the General Pane in the Role Properties window.
If you do also have objects you explicitly don't want it to have access to (say you do give it access to SELECT from all tables on the web schema.), then you can use DENY. If an User has a GRANT and DENY permission, the DENY overrides the GRANT. The only exceptions being db_owners and sysadmin's, which can do whatever they want on the database or server respectively regardless of GRANT and DENY permissions.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
August 10, 2017 at 4:12 am
Another thing to worry about is DMZs and firewalls. If the website is on the other side of a properly set up DMZ, there's no way the account will be able to contact the database without the proper firewall holes being burned. So check with your network administrator(s) to see what needs to be done and where the database server is sitting in regards to where the website is being hosted from.
August 10, 2017 at 8:16 am
Is the connection actually getting to the database server and failing there? The error you see on the .Net side is designed to be vague, you may get a better more specific error from the database's error log using xp_readerrorlog:
http://tomaslind.net/2014/04/22/reading-sql-server-error-log-t-sql-xp_readerrorlog/
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply