IIS 7 and Above
Can't access remote SQL server with Classic ASP website on Windows 20...
Last post Oct 10, 2019 09:06 AM by Jalpa Panchal
Oct 09, 2019 02:43 PM|rogerwithnell|LINK
My classic ASP websites are currently installed on a Windows 2008 server using an MSSQL database 2012 on another Windows 2008 server. They work!
I am trying to move the websites to Windows 2019 server with IIS10 with the database remaining where it is.
On the Windows 2019 server, the websites work from within Visual Studio when they are using the default web server. But they fail when using IIS10 with the error message "An error occurred on the server when processing the URL. Please contact the
The code is as follows:
Set ObjConn = Server.Createobject("ADODB.Connection")
strConnection = "DSN=xxxx; Database=yyyy; UID=aaaa;PWD=bbbb;"
The error is caused when I call objConn.Open strConnection. It seems to me that the code can't connect to the database.
I've set a connection to the remote database in ODBC data sources, which test successfully but doesn't fix the problem. I've also added the connection string to the domain in IIS in the format "Server=wwww.108;DSN=xxxx; Database=yyyy;UID=aaaa;PWD=bbbb".
But this doesn't fix it either.
What am I doing wrong?
Your help would be much appreciated.
Thanking you in anticipation.
Oct 10, 2019 01:39 AM|Jalpa Panchal|LINK
Try to enable the detailed error message for classic asp site in iis and check the what is the actual cause of the error:
This is not enough to get a detailed error message. At this stage, it will only show the error defined by Script Error Message.
Oct 10, 2019 09:03 AM|rogerwithnell|LINK
Many thanks, Jalpa. Fix it!
The detailed error message said that there was an architecture problem between the connection string's driver and application.
In ODBC on the server, I was using SQL Server driver. Changed this to ODBC driver 17 for SQL Server and - bingo!
Oct 10, 2019 09:06 AM|Jalpa Panchal|LINK
I am glad that your issue is resolved.