GLHS
Lions: 2009 Division I Boys Soccer State Champions!
<%
Dim httphost
httphost = Lcase(Request.ServerVariables("HTTP_HOST"))
'strip host name of prefixes, down to domain only
If InStr( (InStr(httphost, ".") + 1), httphost, ".") > 0 Then
'prefix found
httphost = Mid( httphost, (InStr(httphost, ".") + 1), Len(httphost))
End If
Dim connection, cmd, rs, UIString
Set cmd = Server.CreateObject("ADODB.Command")
Set connection = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
'Open Connection
connection.ConnectionString = Application("NativeSQL_ConnectionString")
connection.Open
cmd.ActiveConnection = connection
cmd.CommandText = "SP_ANNOUNCEMENT_GET_DSCOMP"
cmd.CommandType = 4
cmd.Parameters(1).Value = httphost
rs.Open cmd, ,adOpenStatic
UIString = ""
'build html
If rs.EOF Then
UIString = "No announcements for " + FormatDateTime(Now(), 1)
Else
Do Until rs.EOF
UIString = UIString & "
" & rs.Fields(0).Value & ""
rs.MoveNext
Loop
End If
rs.Close
connection.Close
Set connection = Nothing
Set cmd.ActiveConnection = Nothing
Set cmd = Nothing
Set rs = Nothing
Response.Write UIString + "
"
%>