August 15, 2007 at 11:39 am
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
August 15, 2007 at 12:21 pm
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
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply