CFF KB - Carrz-Fox-Fire Promotions Knowledge Base

CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.
  • Breadrumbs:
  • ADODB.Recordset (0x800A0BCD) Either BOF or EOF is True

  • CFF Knowledge Base - Share With Facebook CFF Knowledge Base - Share on Twitter CFF Knowledge Base - Share on Reddit CFF Knowledge Base - Share on Digg It CFF Knowledge Base - Share on Stumble Upon It CFF Knowledge Base - Share on Delicious
    Share With Friends (Updated 6-8-2010)
  • Article ID:
    10
  • Date Created
    Sunday, September 26, 2010
  • Last Updated
    Wednesday, November 17, 2010
  • This Article Has been Viewed
    3176 times
  • Short Desc
    This happens when the record is black. Make sure that there is a record infact in the column of your database. If not, then show the user a friendly error message.
  • Details
    When you create your sql query, you have to make sure that if a record does not exist, you show the user a friendly message informing them that the record does not exist.

    The error you will get is:

     
    ADODB.Field (0x800A0BCD)
    Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
    /MyList.asp, line 61
  • Recreate Issue
    Example:

    <%
    Set getSQL = CreateObject("ADODB.Command")
    getSQL.ActiveConnection=objConn
    getSQL.Prepared = true
    getSQL.commandtext="SELECT colID, colName, colDesc FROM Table1 where colID=?"
    getSQL.Parameters.Append getSQL.CreateParameter("@colID", adInteger, adParamInput, , strcolID)
    set rsgetCol = getSQL.execute
    %>


    <%
    =rsgetCol("colName")
    %>


    now, with the code above, if the colName is blank for the record that is being queried, you will get the error.
  • Resolve Issue
    Example:

    <%
    Set getSQL = CreateObject("ADODB.Command")
    getSQL.ActiveConnection=objConn
    getSQL.Prepared = true
    getSQL.commandtext="SELECT colID, colName, colDesc FROM Table1 where colID=?"
    getSQL.Parameters.Append getSQL.CreateParameter("@colID", adInteger, adParamInput, , strcolID)
    set rsgetCol = getSQL.execute
    if rsgetCol.eof then
    response.write"Sorry, the record does not exist or has been removed from our database."
    else
    getCol = rsgetCol("colName")
    end if
    %>


    <%
    =getCol
    %>


    Looking at the code above, you can see that it is using an
    <%
    if not tsgetCol.eof then
    end if
    %>


    This will run a check against your database, if the record does not exist, it displays a nice little warning message, if the record does exist then it displays the record.