473,378 Members | 1,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Limiting number of records returned

I was given the basics of the code below to display an Access DB. Can anyone
tell me how to limit the number of db records that come up using the code
below...

Thanks
M

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

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

<table> SNIP

<%=RSCat("Name")%>
<%=RSCat("Descript")%>
<%=RSCat("pictu")%>
<%=RSCat("Address1")%>
<%=RSCat("Address2")%>
<%=RSCat("Address3")%>
<%=RSCat("Town")%>
<%=RSCat("Post_Code")%>
T:<%=RSCat("Tel")%>
F:<%=RSCat("Fax")%>
<%=RSCat("Email")%>
<%=RSCat("Web")%> <%=RSCat("id")%>

SNIP </table>

<%
RSCat.MoveNext
wend
RSCat.Close
%>


Jul 19 '05 #1
3 1271
SQL = "SELECT TOP 10
id,Name,Descript,address1,address2,address3,Town,P ost_Code,tel,fax,web,pi
Jul 19 '05 #2
Thanks worked just fine...

Next question... how to get say top 5 and then option to click for more and
see next 5 or less remaining...

M
"Maarten" <no****@pandora.be> wrote in message
news:X0*********************@phobos.telenet-ops.be...
SQL = "SELECT TOP 10
id,Name,Descript,address1,address2,address3,Town,P ost_Code,tel,fax,web,pi

Jul 19 '05 #3
Best start new threads for new questions, but see here.

http://www.aspfaq.com/show.asp?id=2120

Ray at work

"Mettá" <me***@re-movethis-metta.org.uk> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Thanks worked just fine...

Next question... how to get say top 5 and then option to click for more and see next 5 or less remaining...

M
"Maarten" <no****@pandora.be> wrote in message
news:X0*********************@phobos.telenet-ops.be...
SQL = "SELECT TOP 10
id,Name,Descript,address1,address2,address3,Town,P ost_Code,tel,fax,web,pi


Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: BF | last post by:
Hello, I am trying to find out if there is a way to limit the number of rows returned when a cursor is opened. I am using DB2 version 7 on z/OS. The SELECT statement in my DECLARE CURSOR...
3
by: CSDunn | last post by:
Hello, I have a situation with MS Access 2000 in which I need to display report data in spreadsheet orientation (much like a datasheet view for a form). If you think of the report in terms of what...
2
by: Jo Davis | last post by:
access fe and access be. later the be might be sql server I don't want people to pass this application around. And I want control over usage. I want it to 'expire' after a while. I have fairly...
2
by: Sara | last post by:
I have followed instructions on the http://allenbrowne.com/tips.html for limiting a report to a date range. At the bottom there is a note that says You will end up using this form for all sorts...
4
by: N J | last post by:
Hi, I ahve developed a program using access and am distributing it using MDE's, I ahve had many requests for a demo. I was thinking of limiting the number of records to say 100? If anyone has...
17
by: kimimaro | last post by:
How do you limits employee display where you enter the department for all the employee within that department be displayed and if lets say they are 100 or so and you have to limits 10 employee per...
4
by: Chris Tremblay | last post by:
I am trying to figure out how to go about retrieving the number of results returned from my queries in SQL server from VB.NET without using a the Select Count(*) query. The method that I was using...
15
by: Hexman | last post by:
Hello All, How do I limit the number of detail records selected in a Master-Detail set using SQL? I want to select all master records for a date, but only the first 3 records for the details...
1
by: jmarr02s | last post by:
Is it possible to limit the number of Subform records using MS Access 2003? That is, my end users want the capability of entering up to 12 records on their subform. Is that possible? ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.