473,396 Members | 1,777 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Either BOF or EOF is True error makes absolutely no sense

When i put an explicit value in the sql statement below as
"displaygroup =1 ",
i do see my records (or my response.write test after the recordset
Open line) appear on my dynamic page. But when use code below and
match the 'displaygroup'
field with my dp variable (which was assigned in a prior recordset/sql
block) :

<%dim cm,dp
dp = rs("displaygroup")

%>
<% dim rs2,strSQLd2,ii
Set rs2 = Server.CreateObject ("ADODB.Recordset")
strSQLd2 = "Select productname,productprice from products where
displaygroup = " & dp & ""
rs2.Open strSQLd2, dbc
response.write dp %>
....i get the "Either BOF or EOF is true, or record has been deleted"
error, when i know for a fact (since my explicit displaygroup =1 , or
=2 works) there are records that match that criteria.

Thanks for your help
Chumley
Jul 19 '05 #1
5 5012
This error has been bugging me for over a year (never found the cause of it,
as it appears to show, as you've said, even when the record exists). If you
find the answer, I'd be grateful if you could pass it on.

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Chumley the Walrus <sp*******@yahoo.com> wrote in message
news:1e**************************@posting.google.c om...
When i put an explicit value in the sql statement below as
"displaygroup =1 ",
i do see my records (or my response.write test after the recordset
Open line) appear on my dynamic page. But when use code below and
match the 'displaygroup'
field with my dp variable (which was assigned in a prior recordset/sql
block) :

<%dim cm,dp
dp = rs("displaygroup")

%>
<% dim rs2,strSQLd2,ii
Set rs2 = Server.CreateObject ("ADODB.Recordset")
strSQLd2 = "Select productname,productprice from products where
displaygroup = " & dp & ""
rs2.Open strSQLd2, dbc
response.write dp %>
...i get the "Either BOF or EOF is true, or record has been deleted"
error, when i know for a fact (since my explicit displaygroup =1 , or
=2 works) there are records that match that criteria.

Thanks for your help
Chumley

Jul 19 '05 #2
You need to know what the value of dp is instead of assuming that it's a
valid value for your query.

dp = rs("displaygroup")
Response.Write "dp is " & dp
RESPONSE.END

Ray at work

"Chumley the Walrus" <sp*******@yahoo.com> wrote in message
news:1e**************************@posting.google.c om...
When i put an explicit value in the sql statement below as
"displaygroup =1 ",
i do see my records (or my response.write test after the recordset
Open line) appear on my dynamic page. But when use code below and
match the 'displaygroup'
field with my dp variable (which was assigned in a prior recordset/sql
block) :

<%dim cm,dp
dp = rs("displaygroup")

%>
<% dim rs2,strSQLd2,ii
Set rs2 = Server.CreateObject ("ADODB.Recordset")
strSQLd2 = "Select productname,productprice from products where
displaygroup = " & dp & ""
rs2.Open strSQLd2, dbc
response.write dp %>
...i get the "Either BOF or EOF is true, or record has been deleted"
error, when i know for a fact (since my explicit displaygroup =1 , or
=2 works) there are records that match that criteria.

Thanks for your help
Chumley

Jul 19 '05 #3
Which line is getting the error?

Above: rs2.open strSQLd2, dbc
try: response.write strSQLd2
That will show you the problem immediately, if dp is not getting set, or
getting set to something you don't expect..

Also, you don't need that empty & "" at the end of the query. Try
taking it out.

"Chumley the Walrus" <sp*******@yahoo.com> wrote in message
news:1e**************************@posting.google.c om...
When i put an explicit value in the sql statement below as
"displaygroup =1 ",
i do see my records (or my response.write test after the recordset
Open line) appear on my dynamic page. But when use code below and
match the 'displaygroup'
field with my dp variable (which was assigned in a prior recordset/sql
block) :

<%dim cm,dp
dp = rs("displaygroup")

%>
<% dim rs2,strSQLd2,ii
Set rs2 = Server.CreateObject ("ADODB.Recordset")
strSQLd2 = "Select productname,productprice from products where
displaygroup = " & dp & ""
rs2.Open strSQLd2, dbc
response.write dp %>
...i get the "Either BOF or EOF is true, or record has been deleted"
error, when i know for a fact (since my explicit displaygroup =1 , or
=2 works) there are records that match that criteria.

Jul 19 '05 #4
Make sure that it's not attempting to match numeric with string (or even
worse a char() field that is buffered with spaces).

Q. Is displaygroup a numeric field or a textual field?

For debugging make sure you write the querystring to the browser and then
use it in the QueryAnalyzer to see if the query statement is correct.

Chris.

"Chumley the Walrus" <sp*******@yahoo.com> wrote in message
news:1e**************************@posting.google.c om...
When i put an explicit value in the sql statement below as
"displaygroup =1 ",
i do see my records (or my response.write test after the recordset
Open line) appear on my dynamic page. But when use code below and
match the 'displaygroup'
field with my dp variable (which was assigned in a prior recordset/sql
block) :

<%dim cm,dp
dp = rs("displaygroup")

%>
<% dim rs2,strSQLd2,ii
Set rs2 = Server.CreateObject ("ADODB.Recordset")
strSQLd2 = "Select productname,productprice from products where
displaygroup = " & dp & ""
rs2.Open strSQLd2, dbc
response.write dp %>
....i get the "Either BOF or EOF is true, or record has been deleted"
error, when i know for a fact (since my explicit displaygroup =1 , or
=2 works) there are records that match that criteria.

Thanks for your help
Chumley
Jul 19 '05 #5
"Chumley the Walrus" wrote:

dp = rs("displaygroup")

...

Set rs2 = Server.CreateObject ("ADODB.Recordset")
strSQLd2 = "Select productname,productprice from products where
displaygroup = " & dp & ""
rs2.Open strSQLd2, dbc
response.write dp %>


You want the VALUE assigned your variable, not the OBJECT. A much better
practice is to be explicit:

dp = rs.Fields("displaygroup").Value

String concatenation makes a whole lot more sense with values than with
objects. And those values never have EOF/BOF conditions.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

46
by: Scott Chapman | last post by:
There seems to be an inconsistency here: Python 2.3.2 (#1, Oct 3 2003, 19:04:58) on linux2 >>> 1 == True True >>> 3 == True False >>> if 1: print "true" ....
10
by: Vilmar Brazão de Oliveira | last post by:
HI people, what is wrong in the code bellow to kill iexplore.exe process after processing my page?? '»»Before comes routines to access data base and to send email. Set objWshell =...
17
by: Gabriel Mejía | last post by:
Services or applications using ActiveX Data Objects (ADO) 2.0 or greater may intermittently return empty recordsets on queries that should be returning valid results. At the time the problem...
102
by: Skybuck Flying | last post by:
Sometime ago on the comp.lang.c, I saw a teacher's post asking why C compilers produce so many error messages as soon as a closing bracket is missing. The response was simply because the compiler...
33
by: Ruffin Bailey | last post by:
I coulda sworn I was given an explanation during an AppDev class years ago for VB6, but don't recall the answer. Why is it that -1 is True in Visual Basic (and now VB.NET)? Bit flags seem like...
33
by: Martin Jørgensen | last post by:
Hi, In continuation of the thread I made "perhaps a stack problem? Long calculations - strange error?", I think I now got a "stable" error, meaning that the error always seem to come here now...
15
by: atbusbook | last post by:
lets say you want a generic numerical algorithom like sum Ruby def sum lst lst.inject(0){|total,current| total*current} end Java // i dont know if there is a numeric super class for numbers
3
by: Brian A | last post by:
I have written some Javascript that works perfectly in Firefox - no errors reported. The dreaded MSIE 6 produces nothing but a long line of 'undefinedundefinedundefinedundefinedundefined ....'...
40
by: nufuhsus | last post by:
Hello all, First let me appologise if this has been answered but I could not find an acurate answer to this interesting problem. If the following is true: C:\Python25\rg.py>python Python...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.