-1

I have a classic ASP page which when I browse to it throws the error "Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

Below is the code for my ASP test page which is throwing the error:

<%
Session.Timeout = 10
Set dbConn=Server.CreateObject("ADODB.Connection")

On Error Resume Next
dbConn.Open "Provider=SQLOLEDB;server=<MyServer>;database=<MyDatabase>;Trusted_Connection=yes;Integrated Security=SSPI"

for each errobj in dbConn.Errors
    Response.write errobj.Number & "<br />"
    Response.write errobj.Description & "<br />"
next

On Error Goto 0
%>

This is trying to connect to a SQL Server 2008 database server. The site is setup with the application pool using a service account which has access to the database server. There are .aspx.cs pages in the code base which are connecting to the database with no errors and a similar connection string but the classic ASP pages are giving this error. This only happens after we have deployed to our QA server, it runs with no errors locally. The site is setup to run under Anonymous Authentication and all other Authentication modes are disabled.

I'm wondering what settings I may need to enable on the web server to have these requests go through.

Jeff Fol
  • 1,400
  • 3
  • 18
  • 35
  • Could it solve you? http://stackoverflow.com/a/10351155/7733724 It seems your project have not able anonymous access to your public folder when in production. Also could be in relation with the database and you need to establish a rule in the server database firewall or allow anonymous. Depending then of your server environment. – Sam Apr 20 '17 at 17:04
  • Thanks for the link, I tried both the web.config approach suggested and the applicationHost + web.config change but it is still getting the same error. I'll check it out from the firewall perspective but in theory it should not be anonymous because we are using Integrated Security so it should be sent by the service account specified in our Application Pool advanced settings. – Jeff Fol Apr 20 '17 at 17:55

1 Answers1

-1

While looking more online I found this stackoverflow question Classic ASP problem connecting to remote SQL Server database. The recommended answer worked for me. The problem was the requests sent from anonymous pages weren't using the app pool identity as we wanted. The option is either change this setting or change your connection string to use sql authentication user.

Community
  • 1
  • 1
Jeff Fol
  • 1,400
  • 3
  • 18
  • 35