ASP Script to Test MSSQL Database Connectivity
Posted by Ryan D, Last modified by Madhusudan S on 05 August 2015 05:30:35 PM

Provided below is a simple ASP script to test MSSQL database connectivity.

Sample Script

        Set cn = Server.CreateObject("ADODB.Connection")
        cn.Open "Provider=SQLOLEDB;Server=<MSSQL Server IP>;Database=<Database Name>;UID=<Database User>;PWD=<Database User Password>;"
        cn.CommandTimeout = 900
        Response.write("Connected Successfully")

Explanation about the variables used in the script:

  • Server: The MSSQL Server IP needs to be mentioned.



  • Database: Specify exact database name. For example, reseloaq_mssql.

  • UID: Mention the database user associated with the database.

  • PWD: Mention the password for the above database user.

(0 vote(s))
Not helpful

Comments (0)
Post a new comment
Full Name: