ASP Page Error **NEED HELP**
I am having a problem with this ASP page. Could anyone help me out with this.
I get an error message on line 300. Below is the page.
<%
DBOpen
Synchronize
numDay = StringToLong(ReadStr("Day"))
numMonth = StringToLong(ReadStr("Month"))
numYear = StringToLong(ReadStr("Year"))
ParishID = StringToLong(ReadStr("ParishID"))
If Not numMonth>0 Then
numMonth = Month(Now())
End If
If Not numYear>0 Then
numYear = Year(Now())
End If
intFontSize = 3
If numDay>0 Then
If IsDate(numMonth & "/" & numDay & "/" & numYear) Then
intFontSize = 1
strDate = FormatDateTime(numMonth & "/" & numDay & "/" & numYear,1)
End If
End If
If numMonth>1 Then
numPrevMonth = numMonth - 1
numPrevYear = numYear
Else
numPrevMonth = 12
numPrevYear = numYear - 1
End If
If numMonth<12 Then
numNextMonth = numMonth + 1
numNextYear = numYear
Else
numNextMonth = 1
numNextYear = numYear + 1
End If
If 0 Then
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Parish Calendar</title>
</head>
<body><%
End If
%>
<form method=post action=calendar.asp name=frmCalendar>
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="left" bgcolor="#0033CC"> <a
href="calendar.asp?Month=<%=numPrevMonth%>& ;Year=<%=numPrevYear%>&Day=0&ParishID=<%=P arishID%>"><< Previous Month</a><br>
</td>
<td align="center" bgcolor="#0033CC"><b><%=MonthName(numMonth)%>, <%=numYear%></b></td>
<td align="right" bgcolor="#0033CC"><a
href="calendar.asp?Month=<%=numNextMonth%>& ;Year=<%=numNextYear%>&Day=0&ParishID=<%=P arishID%>">Next Month >></a> <br>
</td>
</tr>
</table>
<%
If ParishID>0 Then
SQL = "SELECT DISTINCT EventDate,EventType FROM Events"
SQL = SQL & " WHERE EventDate>=#" & numMonth & "/1/" & numYear & "#"
SQL = SQL & " AND EventDate<#" & numNextMonth & "/1/" & numNextYear & "#"
SQL = SQL & " AND (ParishID=" & ParishID & " OR EXISTS(SELECT * FROM EventParishes WHERE Events.EventID=EventParishes.EventID AND EventParishes.ParishID=" & ParishID & "))"
SQL = SQL & " ORDER BY EventDate,EventType"
Else
SQL = "SELECT DISTINCT EventDate,EventType FROM Events"
SQL = SQL & " WHERE EventDate>=#" & numMonth & "/1/" & numYear & "#"
SQL = SQL & " AND EventDate<#" & numNextMonth & "/1/" & numNextYear & "#"
SQL = SQL & " AND List=True"
SQL = SQL & " ORDER BY EventDate,EventType"
End If
rs.Open SQL, db, adOpenStatic, adLockReadOnly
%>
<table border="2" bordercolor="#000000" width="100%" cellpadding="0"
cellspacing="0">
<tr>
<td>
<table border="1" width="100%">
<tr>
<%
For I = 1 to 7
%>
<th bgcolor="#000000" align="center"><b><%=WeekDayName(I)%></b>
<%
Next ' I
%>
</tr>
<%
Offset = WeekDay(CDate(numMonth & "/1/" & numYear)) - 1
For I = 1 to 6
numDayShow = ((I-1) * 7) + 1 - Offset
If I < 6 OR IsDate(numMonth & "/" & numDayShow & "/" & numYear) Then
%>
<tr>
<%
For J = 1 to 7
numDayShow = ((I-1) * 7) + J - Offset
%>
<td align="right" width="10%" valign="top">"><%
If numDayShow>0 Then
If IsDate(numMonth & "/" & numDayShow & "/" & numYear) Then
dtShow = CDate(numMonth & "/" & numDayShow & "/" & numYear)
If numDay = numDayShow Then
Response.Write "<b>" & numDayShow & "</b>"
Else
%><a
href="calendar.asp?Month=<%=numMonth%>&Year=<% =numYear%>&Day=<%=numDayShow%>&ParishID=<% =ParishID%>"><%=numDayShow%></a><%
End If
%><br>
<%
bDone = False
bShown = False
While Not rs.EOF AND Not bDone
If DateDiff("d",dtShow,rs("EventDate"))=0 Then
strShow = rs("EventType")
If Len(strShow)>16 Then
strShow = Left(strShow,15) & ".."
End If
strShow = Replace (strShow," "," ")
Response.Write strShow & "<br>"
bShown = True
rs.MoveNext
Else
bDone = True
End If
Wend
If Not bShown Then
%><br>
<%
End If
%><%
End If
End If
%></td>
<%
Next ' J
%>
</tr>
<%
End If
Next ' I
%>
</table>
</td>
</tr>
</table>
<%
rs.Close
%>
<table width="100%">
<tr>
<%
For I = 1 to 12
%>
<td><%
If I = numMonth Then
Response.Write "<b>" & MonthName(I) & "</b>"
Else
%>
<a
href="calendar.asp?Month=<%=I%>&Year=<%=nu mYear%>&Day=0&ParishID=<%=ParishID%>"><%=M onthName(I)%></a>
<%
End If
%>
</td>
<%
If I = 6 Then
Response.Write "</tr><tr>"
End If
Next ' I
%>
</tr>
</table>
<%
If intFontSize = 1 Then
%>
<br>
<b><%=strDate%></b><br>
<%
If ParishID>0 Then
SQL = "SELECT * FROM Events"
SQL = SQL & " WHERE EventDate=#" & numMonth & "/" & numDay & "/" & numYear & "#"
SQL = SQL & " AND (ParishID=" & ParishID & " OR EXISTS(SELECT * FROM EventParishes WHERE Events.EventID=EventParishes.EventID AND EventParishes.ParishID=" & ParishID & "))"
SQL = SQL & " ORDER BY EventDate,EventType"
Else
SQL = "SELECT * FROM Events"
SQL = SQL & " WHERE EventDate=#" & numMonth & "/" & numDay & "/" & numYear & "#"
SQL = SQL & " AND List=True"
SQL = SQL & " ORDER BY EventDate,EventType"
End If
rs.Open SQL, db, adOpenStatic, adLockReadOnly
If Not rs.EOF Then
%>
<table cellspacing="10" cellpadding="0" border="0">
<%
While Not rs.EOF
bAllDay = (rs("TimeStart") = 0) AND (rs("TimeEnd") = 0)
If Not bAllDay Then
strStart = FormatDateTime(rs("TimeStart"),3)
strStart = Left(strStart,InStrRev(strStart,":")-1) & LCase(Right(strStart,2))
strEnd = FormatDateTime(rs("TimeEnd"),3)
strEnd = Left(strEnd,InStrRev(strEnd,":")-1) & LCase(Right(strEnd,2))
End If
%>
<tr>
<%
If bAllDay Then
%>
<td valign="top" nowrap><b>ALL DAY</b></td>
<%
Else
%>
<td valign="top" nowrap><b><%=strStart%></b><br>
to <b><%=strEnd%></b></td>
<%
End If
%>
<td valign="top"><%
strLocation = rs("Location")
If Len(strLocation)>0 Then
%><%=rs("EventType")%> for <b><%=rs("Parish")%></b><br>
at <b><%=strLocation%></b><br>
<%
Else
%><%=rs("EventType")%> at <b><%=rs("Parish")%></b><br>
<%
End If
%>
<%=rs("SpeakerName")%>
speaking on <i>"<%=rs("TopicTitle")%>"</i></td>
<%
If Authorized AND Admin Then
%>
<td align="right" valign="top"><a
href="rep-form.asp?Submit=Edit&EventID=<%=rs("EventID")% >"><b>EDIT</b></a></td>
<%
%>
</tr>
<%
End If
strNotes = rs("Notes")
If Len(strNotes)>0 Then
%>
<tr>
<td> </td>
<td colspan="2"><i><%=strNotes%></i></td>
</tr>
<%
End If
rs.MoveNext
Wend
%>
</table>
<%
End If
rs.Close
End If
%>
<br>
<br>
<br>
<%
If Authorized Then
%>Hi <%=Name%>, <a href="../cursillo/rep-form.asp">Add
Events Here</a><%
Else
%>
Are you a Calendar Admin? <a href="login.asp">Add
Events Here</a>
<% End If
%>
</form>
<%
DBClose
If 0 Then
%>
</html>
<%
End If
%>
Line 300 is the last End If and I can't seem to figure it out.
Thanks APD189
|