How do I fix this error message ADODB.Field error '800a0bcd' Either BOF or EOF is True

Posted on 2005-04-11
Medium Priority
Last Modified: 2007-12-19
ADODB.Field error '800a0bcd'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

/www/downloads/ftn/trainingschedule/trainemail.asp, line 75

here is the code for the page line 75 has this tag --ERROR--

<% 'option explicit %>
Response.CacheControl = "no-cache"

<!--#include virtual = "/www/downloads/jjd/Utils/File_IO.asp"-->
<!--#INCLUDE virtual = "/www/downloads/jjd/Utils/adovbs.asp"-->
<!--#Include virtual = "/www/downloads/jjd/secure/DataInfo.asp" -->
<!--#Include virtual = "/www/Include/UsgInclude.asp" -->
<!--#Include virtual = "/www/downloads/jjd/Utils/SendEmail.asp" -->

  'Declare local variables that will be used on this screen
  DIM rc, strquery
  DIM rsMain, strMark
  DIM stremployeename, strCoursename
  DIM strstartdate, strstarttime, strcoursedescription
  DIM szLogMsg, szLogMsgEnd
  DIM mail, strEmailMsg

  ' Create and Open a recordset to the SQL database tables  

Set rsMain = Server.CreateObject("ADODB.Recordset")
strquery = "SELECT *  FROM vw_training_leader_email_data (nolock) WHERE EEID = '" &  strEEID  & "' and classID = '" & strclassId & "' ; "
rsMain.Open strQuery,strConnectFtnWeb,adOpenKeyset,adLockReadOnly,adCmdText

'stremployeename = rsMain("EmployeeName")
'strCoursename = rsMain("CourseName")
'strstartdate = rsMain("StartDate")
'strstarttime = rsMain("StartTime")
'strcoursedescription = rsMain("CourseDescription")

' Prepare Manager Email Message
szLogMsg = ""

szLogMsg = szLogMsg & "<HTML>"
szLogMsg = szLogMsg & "<HEAD></HEAD>"
szLogMsg = szLogMsg & "<BODY><DIV><FONT size=3>"
--ERROR HERE -- szLogMsg = szLogMsg & "<FONT face=Arial><u> " & rsMain("employeeName").Value & "</U></FONT>"
szLogMsg = szLogMsg & "has enrolled in the <U>"  
szLogMsg = szLogMsg & "rsMain('CourseName') &" 
szLogMsg = szLogMsg & "</U> class that will be held on &nbsp;<EM><u>"
szLogMsg = szLogMsg & "rsMain('StartDate') &" 
szLogMsg = szLogMsg & "</U></EM> at <U>"
szLogMsg = szLogMsg & "rsMain('StartTime') &"
szLogMsg = szLogMsg & "</U>.&nbsp; <o:p></o:p></FONT>"
szLogMsg = szLogMsg & "<P><FONT size=3><U>"
szLogMsg = szLogMsg & "rsMain('Coursename') &" 
szLogMsg = szLogMsg & "</U>is:</FONT></P><P><FONT size=3>"
szLogMsg = szLogMsg & "rsMain('CourseDescription') &"
szLogMsg = szLogMsg & "</FONT></P>"
szLogMsg = szLogMsg & "<FONT size=3>You do not need to take any further action, if this meets your approval.</FONT>"
szLogMsg = szLogMsg & "<FONT size=3>&nbsp;</FONT>"
szLogMsg = szLogMsg & "<FONT size=3>However, if you would like this enrollment canceled or another date/time chosen, please click here to view the Frequently Asked Questions on the Training Web site. </FONT>"
szLogMsg = szLogMsg & "<FONT size=3> <br><br>Thanks, </FONT>"
szLogMsg = szLogMsg & "<FONT size=3>Total Comp</FONT></P></FONT></DIV><br>"
szLogMsg = szLogMsg & "</BODY></HTML>"

szLogMsgEnd = ""

' Append Feedback info to the ManagerEmail Log file

DIM szFile
szFile = "ManagerEmail_" & Year(Date) & "-" & Month(Date) & ".log"
rc = AppendToFile (szFile, szLogMsg & szLogMsgEnd)

'If error, set up error message information to pass to the error webpage
if (rc <> 0) then

      Session("ErrorOnFormName")      = "My Stuff - Employee Training Signup"
      Session("ErrorNumber")            = rc
      Session("ErrorDescription")      = ""
      Session("ErrorSource")            = "Error on AppendToFile"

      Response.Redirect ("emailerror.asp")

end if

' Email Manager

szMark = "  |  "

dim strTo, strCc, strBcc, strFrom, strSubject, strMessage, strAttachment, strResults

  strTo         = "jjharris@jjd.com"
  strCc         = ""
  strBcc        = ""
  strFrom       = "TotalComp@jjd
  strSubject    = "My"
  strMessage    = szLogMsg
  strAttachment = "" 

  strResults    = SendEmailMsg(strTo, strCC, strBcc, strFrom, strSubject, strMessage, fSendMsgAsHTML, strAttachment)

  If strResults(0) <> 0 Then

      szErrorMsg = Date & szMark & Time & szMark & strResults(0) & szMark & " Email Not Sent to " & strTo & szMark & strResults(1)
      AppendToFile "ManagerEmail.log", szErrorMsg

      Session("ErrorOnFormName")      = "My"
      Session("ErrorNumber")            = strResults(0)
      Session("ErrorDescription")      = ""
      Session("ErrorSource")            = szErrorMsg

End If

set rsmain = nothing

Question by:MrJarvis2004

Expert Comment

ID: 13757072
seems like your recordset is not returning any records. check the query in the backend.

put conditions like rsMain.EOF=False and then do the concatinations.

Try it.!

LVL 12

Expert Comment

ID: 13757105
when you do a select query, you should to check for the condition whether your query returns any record first:

rsMain.Open strQuery,strConnectFtnWeb,adOpenKeyset,adLockReadOnly,adCmdText

if not rsMain.EOF then

  stremployeename = rsMain("EmployeeName")
  strCoursename = rsMain("CourseName")
  strstartdate = rsMain("StartDate")
  strstarttime = rsMain("StartTime")
  strcoursedescription = rsMain("CourseDescription")
else   'eof (no record)
   response.write("<p>No Record returned</p>")
end if

Author Comment

ID: 13757371
My results is saying no records found but the query works in the backend.
Technology Partners: 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!


Expert Comment

ID: 13757484
You can also put an on error resume next. This will allow you to jump over little errors like this. However you then have to put in some error checking in places that may require authentication.
LVL 13

Expert Comment

ID: 13758384
you must use rsMain.MoveNext() whenever you're trying to pull a row/record from the recordset, that's why you're getting this error

Do Until rsMain.EOF
LVL 13

Expert Comment

ID: 13758408
what are you trying to do..? how do you want results to be displayed..?
LVL 14

Accepted Solution

kiddanger earned 1500 total points
ID: 13759382
I'll just comment on all I see at a quick glance.  Hope you find it helpful...

If you're going to use recordset looping, which I try to discourage, then you should test first and also move to the first record.


If Not rsMain.BOF and Not rsMain.EOF Then
end if

String concatenation is processor intensive and slow.
Open connections late and close early.  Recordset looping doesn't do that. getRows is a better alternative.
Buffering your page will give you better performance.
Use Response.Buffer right after Option Explicit - Not sure why you have it commented out.  It helps during debugging.
CSS is better than deprecated HTML markup.
It is better to DIM multiple variables on one line than single ones per line.
Dim var1, var2, var3
Dim var1
Dim var2
Dim var3
Organize your code and dim all public variables in one area and all private variables in one area.
Dim pubVar1, pubVar2, pubVar3
' code follows

instead of

Dim pubVar1

' code follows

Dim pubVar2

' more code follows

Use subs/functions when possible as well as private variables over public, when possible.
Always clear object variables.  I never saw this closed: strConnectFtnWeb
LVL 14

Expert Comment

ID: 13903543
Thank you Mr. Jarvis.  (O:=

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month13 days, 12 hours left to enroll

755 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