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

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

am 23.01.2008 18:48:41 von ballz2wall

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


<%


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

..netsports

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

am 23.01.2008 22:07:02 von Jon Paal

after opening your connection check to see if EOF is the state before doing a loop

if not rsC.EOF then
......
else
response.write ( "no records found")
end if

".Net Sports" wrote in message news:24898f9d-d45a-4e8c-81da-455fe82aa76d@q21g2000hsa.google groups.com...
>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
>
>
> <%
>
>
> Set rsC = Nothing
> conn.Close
> %>
> '''''''''''''
> Thanks in advance
>
> .netsports