An exception of type 'Adodb.field:Either bof or eof is true

Posted on 2004-11-19
Last Modified: 2008-03-17
I have 2 asp pages. If  I click on a link on the first page I want it to carry the value of that column clicked which will be used in the second page. I then do a request.querystring to get this value in the second page.  The moment I run this code and set a breakpoint my code breaks on (set Rs = objcmd.Execute).
It does not return any record set and I get an error "An exception of type 'Adodb field:either bof or eof is true or the current record had been deleted. Meanwhile If i run this page by itself being the startup page, it comes up very well with all the records but by the time I start from the first page, I get this problem. Pls assist.

Here is the code for the second page:

option explicit
dim rs
dim strsql
dim objparam
dim objcmd
dim imore
dim imaxrecords,test
dim ivalue
set objcmd = server.CreateObject("adodb.command")
set rs = server.CreateObject("adodb.recordset")

'How many records per page do we want to show?
const iRecsPerPage = 15

'get the page number and column to sort by
dim isort,strsort,ipage, dd
isort = Request.QueryString("sort")
ipage = Request.QueryString("page")
ivalue = Request.QueryString("groupnum")
test = "'" & ivalue & "'"

'if these variable arent passed through the querystring assume we are on first page
if len(isort) = 0 or not isnumeric(isort) then isort = 1
if len(ipage) = 0 or not isnumeric(ipage) then ipage= 1

select case isort
      case 1:
      strsort  = "cbh_customer_number"
      case 2:
      strsort = "cbh_product_number"
      case 3:
      strsort = "period"

end select

'show the paged results
objcmd.ActiveConnection = application("DB_connectionString")
objcmd.CommandText = "ProcCurrentPeriod"
objcmd.CommandType = adcmdstoredproc

set objparam = objcmd.CreateParameter("page",adInteger ,adParamInput ,10,ipage)
objcmd.Parameters.append objparam

set objparam = objcmd.CreateParameter("recsperpage",adInteger ,adParamInput ,10,iRecsPerPage)
objcmd.Parameters.append objparam

set objparam = objcmd.CreateParameter("stringsort",advarchar ,adParamInput ,30,strsort)
objcmd.Parameters.append objparam

set objparam = objcmd.CreateParameter("value",advarchar ,adParamInput ,30,test)
objcmd.Parameters.append objparam

set Rs = objcmd.Execute   (****Rs has no value if I set a breakpoint here)

'do we have more records to display (another page?)

imore = rs("moreRecords")

*********Here is the first page where I am passing the value to the destination page
            Do While Not objrs.EOF
                  <td><a href="CurrentPeriodForm.asp?groupnum= <%= objrs("cdb_group_number")%>"><%= objrs("cdb_group_number")%></a></td>
                  <td><%= objrs("cdb_group_name")%></td>
                  <td><%= objrs("emp_name")%></td>
                  <td><a href="javascript:newwindow('ShowNotes.asp?cdbnotes=<%=objRS("cdb_group_number")%>')"> <%= objrs("cdb_note")%></a></td>
                  <td><a href="javascript:newwindow('ShowNotes.asp?analysisnotes=<%=objRS("cdb_group_number")%>')"> <%= objrs("analysis_note")%></a></td>


Question by:Sirdots
    LVL 46

    Accepted Solution

    if not rs.eof then
      imore = rs("moreRecords")
      imore = 0
    end if
    LVL 10

    Expert Comment

    One thing you need to be aware with commands is that the recordset returned is not always a recordset. (Don't ask me why)

    Check your stored procedures for PRINT statements. (If you have query analyzer or something similar - run the stored procedure in that and look for messages) ADO can sometimes recognize printed statements as recordsets. (And it does it with no particular order or with any reasoning!)

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
    I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now