Can't access remote SQL server with Classic ASP website on Windows 2019 with IIS10 [Answered]RSS

3 replies

Last post Oct 10, 2019 09:06 AM by Jalpa Panchal

  • Can't access remote SQL server with Classic ASP website on Windows 2019 with IIS10

    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 system administrator".

    The code is as follows:

    Dim strConnection
    Set ObjConn = Server.Createobject("ADODB.Connection")
    strConnection = "DSN=xxxx; Database=yyyy; UID=aaaa;PWD=bbbb;"
    objConn.Open strConnection
    

    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.

    Roger

  • Re: Can't access remote SQL server with Classic ASP website on Windows 2019 with IIS10

    Oct 10, 2019 01:39 AM|Jalpa Panchal|LINK

    Hi,

    Try to enable the detailed error message for classic asp site in iis and check the what is the actual cause of the error:

    • Open iis manager and select your site.
    • Double click the ASP icon to open the ASP page. Expand the Debugging Properties node and set Send Errors To Browser to True.

    • After doing chnages click on Apply to save the changes.

    This is not enough to get a detailed error message. At this stage, it will only show the error defined by Script Error Message.

    • Go back to the IIS properties and open the section for Error Pages.

    • In error, pages click on the edit feature setting from the action pane.

    • Select the Detailed errors radio button and click ok.

    • Restart the iis and browse your site and check the actual error message.

    Regards,

    Jalpa

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue.
    If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
  • Re: Can't access remote SQL server with Classic ASP website on Windows 2019 with IIS10

    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!

    Much appreciated.

    Roger

  • Re: Can't access remote SQL server with Classic ASP website on Windows 2019 with IIS10

    Oct 10, 2019 09:06 AM|Jalpa Panchal|LINK

    I am glad that your issue is resolved. 

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue.
    If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.