Limit No of records from a DB query

M

Mettá

Hi
Until the issue around DRW's and SP3 is resolved : ((

Can anyone tell me how to limit the number of db results that come up using
the code below...

Thanks
M

<%Dim DSN_Name3
DSN_Name3 = Application("dbNAME_ConnectionString")
set Connection = Server.CreateObject("ADODB.Connection")
Connection.Open DSN_Name3
Search1=Request("Description")
Search2=Request("County")
Search3=Request("Pc1")

Set RSCat = Server.CreateObject("ADODB.RecordSet")
SQL = "SELECT
id,Name,Description,address1,address2,address3,Town,Post_Code,tel,fax,web,pi
cture,email FROM Names WHERE (Description LIKE '%"&Search1& "%' AND County
LIKE '%" &Search2& "%' AND Pc1 LIKE '%" &Search3& "%') ORDER BY Name"
RSCat.Open SQL, Connection
%>
<% while NOT RSCat.EOF %>

<table><td> SNIP
<%=RSCat("Name")%>
<%=RSCat("Description")%>
<%=RSCat("picture")%>
<%=RSCat("Address1")%>
<%=RSCat("Address2")%>
<%=RSCat("Address3")%>
<%=RSCat("Town")%>
<%=RSCat("Post_Code")%>
T:<%=RSCat("Tel")%>
F:<%=RSCat("Fax")%>
<%=RSCat("Email")%>
<%=RSCat("Web")%><%=RSCat("id")%>
</table>

<%
RSCat.MoveNext
wend
RSCat.Close
%>
 
N

Net55

Post this question @ http://www.frontpagewebmaster.com/ASP-
and-FrontPage-Database/forumid-6/tt.htm
-----Original Message-----
Hi
Until the issue around DRW's and SP3 is resolved : ((

Can anyone tell me how to limit the number of db results that come up using
the code below...

Thanks
M

<%Dim DSN_Name3
DSN_Name3 = Application("dbNAME_ConnectionString")
set Connection = Server.CreateObject("ADODB.Connection")
Connection.Open DSN_Name3
Search1=Request("Description")
Search2=Request("County")
Search3=Request("Pc1")

Set RSCat = Server.CreateObject("ADODB.RecordSet")
SQL = "SELECT
id,Name,Description,address1,address2,address3,Town,Post_C ode,tel,fax,web,pi
cture,email FROM Names WHERE (Description
LIKE '%"&Search1& "%' AND County
 
Top