lOCATION detailed view
<%
Response.Expires = 0
Dim objConn, objRS, strQuery, bColor
bColor = "#FFFFFF"
id = Request.QueryString("id")
if (IsNumeric(id)) then
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=c:\sites\Single50\washingtoninst\database\classes.mdb;" _
& "Jet OLEDB:Database Password=healthcenter;"
if (id = "") then
strQuery = "SELECT * FROM Location ORDER BY state"
Set objRS = objConn.Execute(strQuery)
if Not objRS.EOF Then
objRS.MoveFirst
%>
| Name |
Address |
City |
State |
Zip |
Phone |
Fax |
E-mail |
Web site |
|
<%
While Not objRS.EOF
if (bColor = "#CCCCCC") then
bColor = "#FFFFFF"
else
bColor = "#CCCCCC"
end if
%>
| <%=objRS("name")%> |
<%=objRS("address")%> |
<%=objRS("city")%> |
<%=objRS("state")%> |
<%=objRS("zip")%> |
<%=objRS("phone")%> |
<%=objRS("fax")%> |
">Send e-mail |
<%
if (objRS("webaddress") = "") then
Response.Write("N/A")
else
%>
" target="_blank">
Go to Web site
<%
end if
%>
|
<%
objRS.MoveNext
Wend %>
<%
Else
%>
Invalid request!!!
<%
End If
else
strQuery = "SELECT * FROM Location WHERE (locationID = "&id&")"
Set objRS = objConn.Execute(strQuery)
if Not objRS.EOF Then
objRS.MoveFirst
%>
Location |
<%=objRS("name")%> |
Phone |
<%=objRS("phone")%> |
Fax |
<%=objRS("fax")%> |
E-mail |
|
Web site |
|
|
Address |
<%=objRS("address")%> |
City, State Zipcode |
<%=objRS("city")%>, <%=objRS("state")%> <%=objRS("zip")%> |
Directions |
|
|
<%
Else
%>
Invalid request!!!
<%
End If
end if
objRS.close
Set objRS = Nothing
objConn.close
Set objConn = Nothing
else
Response.Write("Invalid Request. Go back and try it again!!! ")
end if
%>
|