<%@LANGUAGE="VBSCRIPT" CODEPAGE="CP_ACP"%>
<%
' '
' Copyright 2002 River Info(tm) - All Rights reserved '
' '
FUNCTION restoreInput(strInput) 'Restores a character that was converted
strInput = Replace(strInput, "'", "'")
restoreInput = strInput
END FUNCTION
Dim strArea : strArea = UCASE(Request.QueryString("area"))
Dim strShowLinks : strShowLinks = UCASE(Request.QueryString("showlinks"))
set soDBConnection = Server.CreateObject("ADODB.Connection") 'Create ADO object for database connection
soDBConnection.Open("DSN=riweather;UID=riweather_ro;PWD=17621ps;") 'Open database connection
IF soDBConnection.State = 1 THEN 'Check database connection is open
set soDBCommand = Server.CreateObject("ADODB.Command") 'Create ADO object for database command
set soDBCommand.ActiveConnection = soDBConnection 'Link database connection to ADO object
soDBCommand.CommandText = "SELECT REPORT, LINKS FROM WEATHER_REPORTS " & _
"WHERE AREA='" & strArea & "';"
set returnDBCommand = soDBCommand.execute() 'Execute ADO command
IF returnDBCommand.EOF = True THEN 'Checks to see if report is found
Response.Write("Weather report not found.")
ELSE 'Executes if report is found
Response.Write("")
Response.Write(restoreInput(returnDBCommand("REPORT")))
IF Strcomp(strShowLinks, "NO") = 0 THEN 'Check for displaying links with report
ELSE 'Executes if links are to be displayed
Response.Write("")
Response.Write(restoreInput(returnDBCommand("LINKS")))
END IF
Response.Write("")
END IF
ELSE 'Executes if unable to open database connection
Response.Write("Unable to get weather report.")
END IF
soDBConnection.Close() 'Close database connection
%>