"Either BOF or EOF is true " error ; form data problem

Discussion in 'ASP General' started by .Net Sports, Jan 23, 2008.

  1. .Net Sports

    .Net Sports Guest

    I have a form that users use a pulldown select listbox to choose a
    category, but sometimes out of the blue, an "Either BOF or EOF is
    true, or the current record has been deleted.." error will pop up on
    the line "strcat_id = getcat("CAT_ID") " line in the asp script that
    the form posts to. In the HTML source code for the page containing the
    input form, all the category names are correctly formatted ( I used a
    trim() function to make sure there were no spaces in the option value
    for the select object)

    ''''block of code that gets the CAT_ID
    <%
    Dim conn, connect, strSQL, strsQL2, getcat, getsub, strcat_id,
    strsub_id

    set conn=server.CreateObject("adodb.connection")
    connect = "Provider=SQLOLEDB;Data Source=whsql-
    v20.prod.mesa1.secureserver.net;Initial Catalog=DB_146345;User
    Id=eatatfreds2;Password=Discount2;"
    conn.Open connect


    Set getcat=Server.CreateObject("adodb.recordset")

    strSQL = "SELECT CAT_ID FROM card_details where category = '" &
    strcategory & "' and issubcat = 'false'"


    getcat.Open strSQL, conn
    strcat_id = getcat("CAT_ID")
    Set getcat = Nothing

    ...%>

    '''''''''''asp block that is creating dynamic data for listbox menu on
    the form input page
    <!-- dynamic category pulldowns -->
    <SELECT name=category>
    <%
    Dim rsC, conn, connect, strSQL

    set conn=server.CreateObject ("adodb.connection")
    connect = "Provider=SQLOLEDB;Data Source=whsql-
    v20.prod.mesa1.secureserver.net;Initial Catalog=DB_146345;User
    Id=eatatfreds2;Password=Discount2;"
    conn.Open connect

    %>
    <%
    dim rsccatid
    Set rsC=Server.CreateObject("adodb.recordset")
    strSQL = "SELECT DISTINCT category,categoryz,CAT_ID FROM card_details
    where issubcat = 0 ORDER BY category"
    rsC.Open strSQL, conn
    rsccatid = rsC("CAT_ID")
    Do while not rsC.EOF
    if Request.querystring("cregion") = rsC("category") then 'if this is
    the selected one then display as selected
    Response.Write "<OPTION VALUE = '" & trim(rsC("category")) & "'
    SELECTED>"
    Response.Write rsC("categoryz") & "</Option>"
    rsC.MoveNext
    else
    Response.Write "<OPTION VALUE = '" & trim(rsC("category")) & "'>"
    Response.Write rsC("categoryz") & "</Option>"
    rsC.MoveNext
    end if
    loop %>

    </SELECT>
    <%


    Set rsC = Nothing
    conn.Close
    %>
    '''''''''''''
    Thanks in advance

    ..netsports
     
    .Net Sports, Jan 23, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mhnazly
    Replies:
    1
    Views:
    691
    Mike Moore [MSFT]
    Oct 28, 2003
  2. Li Zhang
    Replies:
    4
    Views:
    6,147
    softip
    Feb 27, 2009
  3. GTN170777
    Replies:
    2
    Views:
    187
    Jeff Dillon
    Feb 28, 2008
  4. Kevin DeValck
    Replies:
    1
    Views:
    786
    7stud --
    May 17, 2011
  5. rob c
    Replies:
    4
    Views:
    368
    McKirahan
    Dec 30, 2005
Loading...

Share This Page