Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Either BOF or EOF is True ...
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Either BOF or EOF is True ...

 Post Reply Post Reply
Author
ngaisteve1 View Drop Down
Groupie
Groupie
Avatar

Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
Post Options Post Options   Thanks (0) Thanks(0)   Quote ngaisteve1 Quote  Post ReplyReply Direct Link To This Post Topic: Either BOF or EOF is True ...
    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
%>
Back to Top
Gullanian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gullanian Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
ngaisteve1 View Drop Down
Groupie
Groupie
Avatar

Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
Post Options Post Options   Thanks (0) Thanks(0)   Quote ngaisteve1 Quote  Post ReplyReply Direct Link To This Post Posted: 03 November 2003 at 9:37pm

Thanks.

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.