Try the following format. I rarely use Response.Write to write to the browser, unless to see the
what is being passed to the Query, so you will notice use tables:
<%
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)
%>
<html>
<head>
<title>
</title>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<% If quote.eof Then %>
<tr>
<td>Sorry, No Records Found!</td>
</tr>
<% Else %>
<tr>
<td>DISPLAY FOUND RECORDS HERE</td>
</tr>
<% End If %>
</table>
</body>
</html>
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
"Stu" <(E-Mail Removed)> wrote in message
news:1b48e01c44fc0$024ccfc0$(E-Mail Removed)...
> 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"?