Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to configure IIS 10 server to allow Classic ASP to connect to MSSQL server database on a domain

Status
Not open for further replies.

bslintx2021

Technical User
Mar 19, 2021
3
0
0
US
My question is similar to to some forum questions but could not find exact scenario...I believe I am getting a double hop issue and need help to configure IIS and SQL server correctly to allow to display SQL query results on web page

* Have no choice but to use Classic ASP technology and I ran simple asp code to ensure it is working - this have been verified
* SQL server is in mixed mode authentication
* It's been years...but I used to use a trusted connection and it worked...I did not create a SQL user

Class asp SQL connection code
Code:
<%

Set objConnection=Server.CreateObject("ADODB.connection")

ConnectionString = "Provider=SQLOLEDB;Server=my_Server;Database=my_database;Trusted_Connection=yes;" 

objConnection.Open ConnectionString

%>


If I set Anonymous Authentication then the following error:

Microsoft OLE DB Provider for SQL Server error '80040e4d'

Login failed for user 'domain\web_server$'.

If no anonymous or win authentication I get:
HTTP Error 401.2 - Unauthorized
You are not authorized to view this page due to invalid authentication headers.

If Windows authentication I get
Microsoft OLE DB Provider for SQL Server error '80040e4d'

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

I am using Microsoft SQL Server Management Studio and IIS Manager

So, basically...would need help to determine what config changes are needed to connect a IIS 10 web page... using classic asp/ado connection to a MSSQL server set up as mixed mode

Thanks!



 
I use this, but you have to have a user and password:

Code:
<% 
Dim sConnection, objConn , objRS 

sConnection = "DRIVER={MySQL ODBC 3.51 DRIVER}; SERVER=localhost; DATABASE=MYDB; UID=MYUSER;PASSWORD=MYPASS; OPTION=3"

Set Conn = Server.CreateObject("ADODB.Connection")

set objRecordset=Server.CreateObject("ADODB.recordset")


Conn.Open(sConnection) 

%>

THIS CONNECTS TO MYSQL DB


Thanks,
Penguin
Please keep in mind that I am using classic ASP with MySQL database. Not sure if that information helps or not.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top