Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 320
  • Last Modified:

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

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
                  %>
                  <tr>
                  <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>
                  </tr>
                  <%

                  objrs.MoveNext
            Loop
            %>

0
Sirdots
Asked:
Sirdots
1 Solution
 
fritz_the_blankCommented:
if not rs.eof then
  imore = rs("moreRecords")
else
  imore = 0
end if
0
 
thefritterfatboyCommented:
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!)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now