Hi
On the page below, it produces a list of events which took place before the current date.
If there are no events, i want it to produce a message that says 'There are no Events to report on'
because currently it brings up an error message;
Error Type:
ADODB.Recordset (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/new/AddReport.asp, line 55
Can anyone help?
Thanks in advance
On the page below, it produces a list of events which took place before the current date.
If there are no events, i want it to produce a message that says 'There are no Events to report on'
because currently it brings up an error message;
Error Type:
ADODB.Recordset (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/new/AddReport.asp, line 55
Can anyone help?
Thanks in advance
Code:
<%
Option Explicit
Dim StrConnect
%>
<!-- #INCLUDE FILE="ProjectConnection.asp" -->
<%
If Session("Username") = "" Then
Response.Redirect "Error.asp"
End If
%>
<HTML>
<HEAD>
<TITLE>Add Event Report</TITLE>
</HEAD>
<BODY>
<BODY bgcolor="#99CCFF">
<div id="content">
<input type="button" onClick="document.all.content.style.zoom=(document.all.content.style.zoom==1?2:1);" value="Change Font Size">
<p align="center"><u><b><font size="7" face="Arial">Add an Event Report </font></b></u></p>
<table align="center" cellspacing="5" border="6">
<tr>
<td><font face="Arial"><a href="RegisteredUsersHome.asp">Home</a></font></td>
<td><font face="Arial"><a href="DiscussionBoard.asp">Discussion</a></font></td>
<td><font face="Arial"><a href="Feedback.asp">Feedback</a></font></td>
<td><font face="Arial"><a href="Donations.asp">Donation</a></font></td>
<td><font face="Arial"><a href="NewsLetter.asp">Newsletter</a></font></td>
<td><font face="Arial"><a href="SiteMap.asp">Site Map</a></font></td>
<td><font face="Arial"><a href="AboutUs.asp">About Us</a></font></td>
<td><font face="Arial"><a href="Links.asp">Other Links</a></font></td>
</table>
<p align="center">
<font face="Arial">
<a href="EventReport.asp">Event Report</a>
<a href="Events.asp">Forthcoming Events</a>
<a href="PastEvents.asp">Past Events</a>
</font>
</p>
<p>
<font face="Arial">
<BR>
<%
Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "SELECT * FROM Events WHERE [date] < Now()", strConnect, 3,3
objRS.MoveFirst
%>Event Name </font>
</p>
<FORM ACTION = "addreporttodb.asp" METHOD= "post">
<font face="Arial">
<SELECT NAME="EventName" SIZE="1">
<%
Do While NOT objRS.EOF
Response.Write "<OPTION VALUE='" & objRS("Event Name") & "'>"
Response.Write objRS("Event Name") & "</OPTION>"
objRS.MoveNext
Loop
objRS.Close
Set objRS = Nothing
%>
</SELECT> </font>
<P><font face="Arial">Date<input type="text" name = "txtDate" size="20"><BR>
Report<BR>
<textarea name="txtReport" col="200" rows="12" wrap="virtual" cols="40"></textarea> <BR>
<BR>
<INPUT TYPE="SUBMIT" VALUE="Submit"></font></form>
</div>
</body>
</html>