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

N

.Net Sports

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top