From: Angelutalula on
I am having a problem with the following code, as i get the following
error:

ADODB.Field error '800a0bcd'

Either BOF or EOF is True, or the current record has been deleted.
Requested operation requires a current record.

/roombookings/development/SummaryByDay.asp, line 148


my code is as follows:

<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/Rooms.asp" -->

<%
var InDate = Server.CreateObject("ADODB.Recordset");
InDate.ActiveConnection = MM_Rooms_STRING;
InDate.Source = "SELECT * FROM DateRecord WHERE CurrentDate >=
date() AND CurrentDate <= date() + 30 ORDER BY CurrentDate ASC";
InDate.CursorType = 0;
InDate.CursorLocation = 2;
InDate.LockType = 1;
InDate.Open();
var InDate_numRows = 0;
%>
<%
var Recordset1__MMColParam = "18/08/2005";
if (String(Request.Form("InDate")) != "undefined" &&
String(Request.Form("InDate")) != "") {
Recordset1__MMColParam = String(Request.Form("InDate"));
}
%>
<%
var Recordset1 = Server.CreateObject("ADODB.Recordset");
Recordset1.ActiveConnection = MM_Rooms_STRING;
Recordset1.Source = "SELECT * FROM ResourceSummary LEFT JOIN
ScheduledLesson ON
ResourceSummary.Day=ScheduledLesson.Dayoflesson AND
ResourceSummary.Resource=ScheduledLesson.Resource WHERE BookingDate =
'"+ Recordset1__MMColParam.replace(/'/g, "''") + "' ORDER BY
ResourceSummary.Resource ASC";
Recordset1.CursorType = 0;
Recordset1.CursorLocation = 2;
Recordset1.LockType = 1;
Recordset1.Open();
var Recordset1_numRows = 0;
%>
<%
var Lessons = Server.CreateObject("ADODB.Recordset");
Lessons.ActiveConnection = MM_Rooms_STRING;
Lessons.Source = "SELECT * FROM ScheduledLesson WHERE Dayoflesson =
'Monday' ";
Lessons.CursorType = 0;
Lessons.CursorLocation = 2;
Lessons.LockType = 1;
Lessons.Open();
var Lessons_numRows = 0;
%>
<%
var Repeat2__numRows = -1;
var Repeat2__index = 0;
Recordset1_numRows += Repeat2__numRows;
%>
<% var MM_paramName = ""; %>
<%
// *** Go To Record and Move To Record: create strings for maintaining
URL and Form parameters

// create the list of parameters which should not be maintained
var MM_removeList = "&index=";
if (MM_paramName != "") MM_removeList += "&" +
MM_paramName.toLowerCase() + "=";
var MM_keepURL="",MM_keepForm="",MM_keepBoth="",MM_keepNone="";

// add the URL parameters to the MM_keepURL string
for (var items=new Enumerator(Request.QueryString); !items.atEnd();
items.moveNext()) {
var nextItem = "&" + items.item().toLowerCase() + "=";
if (MM_removeList.indexOf(nextItem) == -1) {
MM_keepURL += "&" + items.item() + "=" +
Server.URLencode(Request.QueryString(items.item()));
}
}

// add the Form variables to the MM_keepForm string
for (var items=new Enumerator(Request.Form); !items.atEnd();
items.moveNext()) {
var nextItem = "&" + items.item().toLowerCase() + "=";
if (MM_removeList.indexOf(nextItem) == -1) {
MM_keepForm += "&" + items.item() + "=" +
Server.URLencode(Request.Form(items.item()));
}
}

// create the Form + URL string and remove the intial '&' from each of
the strings
MM_keepBoth = MM_keepURL + MM_keepForm;
if (MM_keepBoth.length > 0) MM_keepBoth = MM_keepBoth.substring(1);
if (MM_keepURL.length > 0) MM_keepURL = MM_keepURL.substring(1);
if (MM_keepForm.length > 0) MM_keepForm = MM_keepForm.substring(1);
%>
<%
var Repeat1__numRows = 10;
var Repeat1__index = 0;
Recordset1_numRows += Repeat1__numRows;
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://
www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>Feversham College - Room Booking</title>
<style type="text/css">
<!--
..style1 {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
font-size: 18px;
}
..style2 {font-family: Arial, Helvetica, sans-serif}
..style10 {font-family: Arial, Helvetica, sans-serif; font-size: 12px;
font-weight: bold; }
..style11 {font-family: Arial, Helvetica, sans-serif; font-size: 12px;
color: #000099; }
..style13 {font-family: Arial, Helvetica, sans-serif; font-size: 12px;
color: #000099; font-weight: bold; }
..style15 {
font-size: 12px;
font-family: Arial, Helvetica, sans-serif;
color: #0000CC;
}
..style21 {font-family: Arial, Helvetica, sans-serif; font-size: 14px;
color: #000099; font-weight: bold; }
..style22 {color: #009933}
..style23 {color: #FFCC00}
..style24 {font-size: larger}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--


function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value
+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>

<body>
<table width="917" border="0">
<tr>
<td width="209"><div align="center"><img src="logo%20words.gif"
width="137" height="136"></div></td>
<td width="698"><p align="center" class="style1"><img
src="logo.gif" width="485" height="104"></p>
<p align="center" class="style1 style23">Resource Booking</p></td>
</tr>
</table>
<form name="form1" method="post" action="">
<p align="center" class="style2">Select a date to view the bookings
for that day:
<select name="InDate" id="InDate">
<%
while (!InDate.EOF) {
%>
<option value="<%=(InDate.Fields.Item("CurrentDate").Value)%>"
selected><%=(InDate.Fields.Item("CurrentDate").Value)%></option>
<%
InDate.MoveNext();
}
if (InDate.CursorType > 0) {
if (!InDate.BOF) InDate.MoveFirst();
} else {
InDate.Requery();
}
%>
</select>
<input type="submit" name="Submit" value="Submit">
</p>
<p class="style10">Resources for : &nbsp;<
%=(Recordset1.Fields.Item("Day").Value)%> .
<%=(Recordset1.Fields.Item("BookingDate").Value)%> </p>
<table width="950" border="1" cellpadding="2" cellspacing="0">
<tr align="center" valign="middle">
<td width="80"><span class="style10">Resource</span></td>
<td>&nbsp;</td>
<td width="110"><span class="style10">1</span></td>
<td width="110"><span class="style10">2</span></td>
<td width="110"><span class="style10">3</span></td>
<td width="110"><span class="style10">4</span></td>
<td width="110"><span class="style10">5</span></td>
<td width="110"><span class="style10">6</span></td>
<td width="110"><span class="style10">After School </span></td>
</tr>
<% while ((Repeat2__numRows-- != 0) && (!Recordset1.EOF)) { %>
<tr align="center" valign="middle" bgcolor="#FFFFCC">
<td nowrap><span class="style21"><
%=(Recordset1.Fields.Item("Resource").Value)%></span></td>
<td height="51" nowrap><span class="style10">Lessons</span></td>
<td><div align="center"><span class="style11"><
%=(Recordset1.Fields.Item("SLStaff1").Value)%><br>
<span class="style22"><
%=(Recordset1.Fields.Item("SLTeachingGroup1").Value)%></span> <br>
<%=(Recordset1.Fields.Item("SLComment1").Value)%></span></
div></td>
<td><span class="style15"><
%=(Recordset1.Fields.Item("SLStaff2").Value)%><br>
<span class="style22"><
%=(Recordset1.Fields.Item("SLTeachingGroup2").Value)%></
span><br>
<%=(Recordset1.Fields.Item("SLComment2").Value)%></span></td>
<td><span class="style11"><
%=(Recordset1.Fields.Item("SLStaff3").Value)%><br>
<span class="style22"><
%=(Recordset1.Fields.Item("SLTeachingGroup3").Value)%></span><br>
<%=(Recordset1.Fields.Item("SLComment3").Value)%></span></td>
<td nowrap><span class="style11"><
%=(Recordset1.Fields.Item("SLStaff4").Value)%><br>
<span class="style22"><
%=(Recordset1.Fields.Item("SLTeachingGroup4").Value)%></span><br>
<%=(Recordset1.Fields.Item("SLComment4").Value)%></span></td>
<td nowrap><span class="style11"><
%=(Recordset1.Fields.Item("SLStaff5").Value)%><br>
<span class="style22"><
%=(Recordset1.Fields.Item("SLTeachingGroup5").Value)%></span><br>
<%=(Recordset1.Fields.Item("SLComment5").Value)%></span></td>
<td nowrap><span class="style11"><
%=(Recordset1.Fields.Item("SLStaff6").Value)%><br>
<span class="style22"><
%=(Recordset1.Fields.Item("SLTeachingGroup6").Value)%></span><br>
<%=(Recordset1.Fields.Item("SLComment6").Value)%></span></td>
<td nowrap><span class="style11"><
%=(Recordset1.Fields.Item("SLStaff7").Value)%><br>
<span class="style22"><
%=(Recordset1.Fields.Item("SLTeachingGroup7").Value)%></span><br>
<%=(Recordset1.Fields.Item("SLComment7").Value)%></span></td>
</tr>
<tr align="center" valign="middle">
<td width="80" nowrap>&nbsp;</td>
<td height="51" nowrap><p class="style13">Single<br>
Booking
</p>
</td>
<td><p class="style11"><A HREF="Modify.asp?<%=
Server.HTMLEncode(MM_keepNone) + ((MM_keepNone!="")?"&":"") + "ID=" +
Recordset1.Fields.Item("IdNumber").Value %>"> </A><a
href="Modify1.asp?<%= Server.HTMLEncode(MM_keepNone) + ((MM_keepNone!
="")?"&":"") + "IDNumber=" + Recordset1.Fields.Item("IDNumber").Value
+ "&Status1=" + Recordset1.Fields.Item("Staff1").Value +
"&period=1"+"&LB=" +Recordset1.Fields.Item("SLStaff1").Value %>"><
%=(Recordset1.Fields.Item("Staff1").Value)%></a><br>
<span class="style22"><
%=(Recordset1.Fields.Item("TeachingGrp1").Value)%></span><br>
<%=(Recordset1.Fields.Item("Comment1").Value)%><br>
</p>
</td>
<td><p class="style11"> <a href="Modify2.asp?<%=
Server.HTMLEncode(MM_keepNone) + ((MM_keepNone!="")?"&":"") +
"IDNumber=" + Recordset1.Fields.Item("IDNumber").Value + "&Status1=" +
Recordset1.Fields.Item("Staff2").Value + "&period=2"+"&LB="
+Recordset1.Fields.Item("SLStaff2").Value %>"><
%=(Recordset1.Fields.Item("Staff2").Value)%></a><br>
<span class="style22"><
%=(Recordset1.Fields.Item("TeachingGrp2").Value)%></span><br>
<%=(Recordset1.Fields.Item("Comment2").Value)%><br>
</p>
</td>
<td><p class="style11"> <a href="Modify3.asp?<%=
Server.HTMLEncode(MM_keepNone) + ((MM_keepNone!="")?"&":"") +
"IDNumber=" + Recordset1.Fields.Item("IDNumber").Value + "&Status1=" +
Recordset1.Fields.Item("Staff3").Value + "&period=3"+"&LB="
+Recordset1.Fields.Item("SLStaff3").Value %>"><
%=(Recordset1.Fields.Item("Staff3").Value)%></a><br>
<span class="style22"><
%=(Recordset1.Fields.Item("TeachingGrp3").Value)%></span><br>
<%=(Recordset1.Fields.Item("Comment3").Value)%></p>
</td>
<td nowrap><p class="style11"> <a href="Modify4.asp?<%=
Server.HTMLEncode(MM_keepNone) + ((MM_keepNone!="")?"&":"") +
"IDNumber=" + Recordset1.Fields.Item("IDNumber").Value + "&Status1=" +
Recordset1.Fields.Item("Staff4").Value + "&period=4"+"&LB="
+Recordset1.Fields.Item("SLStaff4").Value %>"><
%=(Recordset1.Fields.Item("Staff4").Value)%></a><br>
<span class="style22"><
%=(Recordset1.Fields.Item("TeachingGrp4").Value)%></span><br>
<%=(Recordset1.Fields.Item("Comment4").Value)%></p>
</td>
<td nowrap><p class="style11"> <a href="Modify5.asp?<%=
Server.HTMLEncode(MM_keepNone) + ((MM_keepNone!="")?"&":"") +
"IDNumber=" + Recordset1.Fields.Item("IDNumber").Value + "&Status1=" +
Recordset1.Fields.Item("Staff5").Value + "&period=5"+"&LB="
+Recordset1.Fields.Item("SLStaff5").Value %>"><
%=(Recordset1.Fields.Item("Staff5").Value)%></a><br>
<span class="style22"><
%=(Recordset1.Fields.Item("TeachingGrp5").Value)%></span><br>
<%=(Recordset1.Fields.Item("Comment5").Value)%></p>
</td>
<td nowrap><p class="style11"> <a href="Modify6.asp?<%=
Server.HTMLEncode(MM_keepNone) + ((MM_keepNone!="")?"&":"") +
"IDNumber=" + Recordset1.Fields.Item("IDNumber").Value + "&Status1=" +
Recordset1.Fields.Item("Staff6").Value + "&period=6"+"&LB="
+Recordset1.Fields.Item("SLStaff6").Value %>"><
%=(Recordset1.Fields.Item("Staff6").Value)%></a><br>
<span class="style22"><
%=(Recordset1.Fields.Item("TeachingGrp6").Value)%></span><br>
<%=(Recordset1.Fields.Item("Comment6").Value)%></p>
</td>
<td nowrap><p class="style11"> <a href="Modify7.asp?<%=
Server.HTMLEncode(MM_keepNone) + ((MM_keepNone!="")?"&":"") +
"IDNumber=" + Recordset1.Fields.Item("IDNumber").Value + "&Status1=" +
Recordset1.Fields.Item("Staff7").Value + "&period=7"+"&LB="
+Recordset1.Fields.Item("SLStaff7").Value %>"><
%=(Recordset1.Fields.Item("Staff7").Value)%></a><br>
<span class="style22"><
%=(Recordset1.Fields.Item("TeachingGrp7").Value)%></span><br>
<%=(Recordset1.Fields.Item("Comment7").Value)%></p>
</td>
</tr>
<%
Repeat2__index++;
Recordset1.MoveNext();
}
%>
</table>
<p class="style24">If you would like to be added as a user please
contact IT. </p>
<p><b><font size="4">C25 - Collect the remote for the IWB from the IT
Office</font></b></p>
</form>
</body>
</html>
<%
InDate.Close();
%>
<%
Recordset1.Close();
%>
<%
Lessons.Close();
%>

I believe my problem is the fact that the date is set to an old one
i.e. 18/08/2005 is there a way that this can be set to
today() ????