Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem having ADODB.Field error '800a0bcd'

    When I execute my asp written page i encountered an error known as

    <ADODB.Field error '800a0bcd'
    Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. >

    But I've checked that my recordset did contain records and my session did not times out.

    Enclosed are my coding which i suspect the errors might be raised from
    <%
    If gender = "M" Then

    set rs=Server.CreateObject("ADODB.recordset")
    rs.Open "SELECT age_category" & ageCategory & " As stdWeight FROM standard_male_BMI WHERE male_height = '" & roundedHeight & "'",dbConnection

    sStandardWeight = rs("stdWeight")
    obesity = ((tempWeight - sStandardWeight)/sStandardWeight) * 100
    obesity = Round(obesity,2)

    If (language = "TEXT") Then

    If (obesity < 10.00) Then
    obesityLevel = "Normal"
    ElseIf (obesity >= 10.00 AND obesity <= 20.00) Then
    obesityLevel = "Slightly Fat"
    ElseIf (obesity > 20.00) Then
    obesityLevel = "Obese"
    End If

    advice = "Standard Weight: " & trim(rs("stdWeight")) & "kg" & vbNewLine
    advice = advice & "Obesity: " & obesity & "%" & vbNewLine
    advice = advice & "Obesity level: " & obesityLevel

    compareDesiredWeight = advice

    response.write "<BR>" &compareDesiredWeight
    Else
    set rs1=Server.CreateObject("ADODB.recordset")
    rs1.Open "SELECT * FROM pushMessageCHContent",dbConnection

    If (obesity < 10.00) Then
    obesityLevel = rs1("msg_normal")
    ElseIf (obesity >= 10.00 AND obesity <= 20.00) Then
    obesityLevel = rs1("msg_slight_fat")
    ElseIf (obesity > 20.00) Then
    obesityLevel = rs1("msg_obese")
    End If
    advice = trim(rs1("msg_std_weight")) & trim(rs("stdWeight")) & "kg" & vbNewLine
    advice = advice & trim(rs1("msg_obesity")) & obesity & "%" & vbNewLine
    advice = advice & trim(rs1("msg_remark")) & obesityLevel

    compareDesiredWeight = advice

    set rs1 = Nothing End if
    set rs = Nothing
    End If
    %>
    Can someone pls kindly point out to me what possibly cause this error? Ur help is very much appreciated. Thanks.

  • #2
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,092
    Thanks
    2
    Thanked 23 Times in 23 Posts
    One thing that comes to mind that you should probably have right after each of your queries, rather than just assuming you'll always have a recordset to work with in the rest of your script:

    Code:
    If (rs.RecordCount = 0) Then
       'Some error routine
    End If
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Recordset returns -1 if the right cursor type is not specified. Other method to check if a recordset contains record or not regardless of cursor type specified is this:
    Code:
    If rs.BOF or rs.EOF Then
       'Record(s) not found
    Else
       'Display record(s)
    End If
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •