expert web world control panel Get 1 GB space in INR 1000 only yearly with cpanel and free business email accounts. Call Us +91 9878357855 , +91 8558066955
Join Us : web design facebookweb design twitterweb design linkedincall us on skype

ASP Script to Test MSSQL Database Connectivity

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.