Forums
This topic is locked
Error: Either BOF or EOF is True
Posted 05 Apr 2001 22:14:52
1
has voted
05 Apr 2001 22:14:52 SA Sanders posted:
I'm trying to search a recordset using 2 Form fields - City and State.In the search form, if I put in a City/State combo that exists in the DB, I get the results correctly.
If I put in a City/State combo that does NOT exist, I get this error message:
ADODB.Recordset error '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/admin/orgResuts.asp, line 68
Here's the 'advanced' SQL code I have in UltraDev:
SELECT City, Organization, OrgID, State, Zip
FROM Organizations
WHERE City LIKE '%varCity%' AND State LIKE '%varState%'
ORDER BY State ASC
And then I have my variables defined below in that 2nd box.
varCity % Request.Form("txtCity"
varState % Request.Form("mnuState"
What would cause this to work sometimes and error at other times?
btw, here's where line 68 is:
' reset the cursor to the beginning
If (rsOrgsResults.CursorType > 0) Then
rsOrgsResults.MoveFirst <---line 68
Else
rsOrgsResults.Requery
End If
Replies
Replied 10 Apr 2001 22:25:11
10 Apr 2001 22:25:11 Waldo Smeets replied:
I'm not sure, but I think you should hide the 'Show if recordset is not empty' server behavior on the area where you are using the recordset fields. That should solve the problem.
Waldo Smeets - www.UDzone.com Webmaster
------------------------------------------
www.UDzone.com : A Dreamweaver, Ultradev and Fireworks recourse site for developers
by developers.
------------------------------------------
Waldo Smeets - www.UDzone.com Webmaster
------------------------------------------
www.UDzone.com : A Dreamweaver, Ultradev and Fireworks recourse site for developers
by developers.
------------------------------------------
Replied 03 Apr 2007 12:53:01
03 Apr 2007 12:53:01 Timbo Nagasaki replied:
You can't move first if their is no first.. i'm currently looking how to resolve this myself, there needs to be another check.. but you cant do a eof check before the "movefirst"ing since it will be eof weather you got to the eof or if it has no records.. i wonder if just a bof check would work instead?
Replied 03 Apr 2007 12:56:20
03 Apr 2007 12:56:20 Timbo Nagasaki replied:
try this it worked for me
if NOT rsXX.BOF then
rsXX.MoveFirst()
end if
so in your code:
If (rsOrgsResults.CursorType > 0) Then
if not rsOrgsResults.bof then
rsOrgsResults.MoveFirst <---line 68
end if
Else
rsOrgsResults.Requery
End If
Edited by - labrys1 on 03 Apr 2007 12:58:02
if NOT rsXX.BOF then
rsXX.MoveFirst()
end if
so in your code:
If (rsOrgsResults.CursorType > 0) Then
if not rsOrgsResults.bof then
rsOrgsResults.MoveFirst <---line 68
end if
Else
rsOrgsResults.Requery
End If
Edited by - labrys1 on 03 Apr 2007 12:58:02