Print Page | Close Window

Either BOF or EOF is True ...

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=6940
Printed Date: 31 March 2026 at 12:07pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Either BOF or EOF is True ...
Posted By: ngaisteve1
Subject: Either BOF or EOF is True ...
Date Posted: 03 November 2003 at 2:23am
I received an error mesg saying

ADODB.Field (0x80020009)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

This page is actually displaying a page where user can update multiple record. This means that example, 3 products will come out. There will be a textbox of every product. I name this textbox Quantity and when user has key in the quantity of these 3 product and click Add to list, the system will update all these 3 records. Something like we see in Shopping cart.

I think the error is somewhere around here:

<%
sql = "SELECT * FROM product "
sql = sql & "WHERE pcategory = '" & strCategory &"' "
sql = sql & "AND ptype = '" & strType &"' ORDER BY pname"
rs.CursorLocation = 3
rs.Open sql, conn
%>
<tr>
<td colspan=2>
<table border=1 cellspacing=0 cellpadding=2>
<form action=product_del.asp method=post onSubmit="return ValidateForm(this,'list')">
<tr><td><input type="hidden" name="<%= (iCount & ".ID") %>" value="<%=rs("ProductID")%>"></td></tr>
<tr><td><input type="hidden" name="Count" value="<%= iCount - 1 %>"></td></tr>
<tr valign="middle" bgcolor="#666666" style="color:#FFFFFF">
<td nowrap>Product Name</td>
<td nowrap>Category</td>
<td nowrap>Type</td>
<td nowrap>Price</td>
<td nowrap>Quantity</td>
<td> </td>
</tr>
<%
dim iCount
iCount = 0
DO WHILE ((RepeatCart_numRows <> 0) AND (NOT rs.eof))
RepeartCart_index = RepeatCart_index + 1
RepeatCart_numRows = RepeatCart_numRows - 1
response.Write "<tr valign=top><td><A onclick=" & Chr(34) & "NewWindow(this.href,'name','500','470','no');return false" & Chr(34) & " class=" & Chr(34) & "content" & Chr(34) & " HREF='product_view_form.asp?passProductID=" & rs("productID") & "'>" & rs("pname") & "</a></td>"
response.write "<td nowrap>" & rs("PCategory") & " </td>"
response.write "<td nowrap>" & rs("PType") & " </td>"
response.write "<td nowrap>" & rs("PPrice") & " </td>"
response.write "<td nowrap><input type=text name=" & iCount & ".Qty" & " value=" & rs("quantity") & "></td>"
response.write "<td><input type='checkbox' id=" & rs("ProductID") & " name='list' value=" & rs("ProductID") & " onClick=" & Chr(34) & "setParentTR(event, 'background', '#E8E8E8', 'white')""></td></tr>"
iCount = iCount + 1
rs.MoveNext
LOOP
%>



Replies:
Posted By: Gullanian
Date Posted: 03 November 2003 at 2:41am

sql = "SELECT * FROM product "
sql = sql & "WHERE pcategory = '" & strCategory &"' "
sql = sql & "AND ptype = '" & strType &"' ORDER BY pname"

The error is there.  Its trying to find a record which doesnt exist.  To solve this, after rs.open strSQL conn do:

If rs.Eof then
 response.write("none found")
Else
 'rest of code
end if



Posted By: ngaisteve1
Date Posted: 03 November 2003 at 9:37pm

Thanks.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net