asp results page

S

Stu

I'm using this code display results based on a number
entered into a form.

<%
ID = Request.QueryString( "ID")
if ID ="" then ID ="1"

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "DRIVER={Microsoft Access Driver
(*.mdb)};DBQ=C:mypath\mydatabase.mdb"

quote = "SELECT * FROM Results Where ID = "& ID &""
Set quote = Conn.Execute( quote)

if quote.eof then
Response.write("No records found.")
end if

%>

It works fine, but when you do a seach and there is no
record, you get this error message:

No records Found

ADODB.Field error '80020009'

Either BOF or EOF is True, or the current record has been
deleted. Requested operation requires a current record.

/quote/test2view/testview.asp, line 0

How do I get rid of the error message and have it only
say "No records found"?
 
C

clintonG

Better yet. Discover the ASP FAQ [1] where this exact problem as
well as many others is documented. You can also get support from
developers via:

* news://microsoft.public.inetserver.asp.general
* news://microsoft.public.inetserver.asp.db

--
<%= Clinton Gallagher
A/E/C Consulting, Web Design, e-Commerce Software Development
Wauwatosa, Milwaukee County, Wisconsin USA
NET csgallagher@ REMOVETHISTEXT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/

[1] http://www.aspfaq.com/
 

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


Top