Test connectivity from a web server to a back-end SQL server?

  • I have a question from a practice test. Does anyone know the answer.

     

    How would you test connectivity from a web server to a back-end SQL server?

     

    thanks!

     

    Kevin

  • a simple asp web page like this would work; change the connection info toyour page, put it somewhere on the web server and browse to that page:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

    <HTML>

      <HEAD>

        <TITLE> New Document </TITLE>

      </HEAD>

      <BODY>

      <%

        ON ERROR RESUME NEXT

        dim cnn 'AS Object

        set cnn = server.createobject("ADODB.Connection")

        response.write "Attempting to open connection.<BR>"

        cnn.open "PROVIDER=SQLOLEDB;DATA SOURCE=stormsql;UID=sa;PWD=thisismypassword;DATABASE=stormcensuszip;"

        IF Err.Number <> 0 then

          Response.Write "Failure to connect: " & Err.Number & " - " & Err.Description

        else

          Response.Write "Connection Successful."

        end if

    %>

    </BODY>

    </HTML>

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply