473,326 Members | 2,173 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,326 software developers and data experts.

How to limit number of records found a query

I would like to keep users from using a % to query my db as it puts a load on the server. If I could limit the max records returned to 30,000 it would be wonderful.
Here is the select code from a multi-part form.
Expand|Select|Wrap|Line Numbers
  1.  strSQL = "SELECT * FROM TABLE WHERE "
  2.  
  3.       for x = 0 to UBound(arrParams)
  4.          if arrParams(x, FIELD_MINVAL) <> "" or arrParams(x, FIELD_MAXVAL) <> "" then
  5.             if x > 0 and strSQL <> "SELECT * FROM TABLE WHERE " then
  6.                strSQL = strSQL & " AND "
  7.             end if
  8.  
Sep 17 '16 #1
3 1964
ADezii
8,834 Expert 8TB
Why not use the SQL SELECT Top Clause?
Sep 17 '16 #2
I tried to get that to work with no luck
Sep 17 '16 #3
Ok thanks I got it to work
Sep 17 '16 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: mo | last post by:
I'm using the query desinger in ASP.NET , however the number of records in the resultset are not displaying, so I cut and paste it into Query analyzer which is silly. How do I set this in the...
4
by: amywolfie | last post by:
Hi All: In FileMaker Pro, the error number for "no records found" is 401. What is the equivalent error number in Access (2003)? I want to capture for the "On Open" Event of a report. If...
4
by: amywolfie | last post by:
I would like to put code behind a Find button on a form which: 1) Performs a find based on a field on the form 2) If NO RECORDS ARE FOUND, then displays a custom "No Records Found" message box. ...
0
by: brown3313 | last post by:
I am new to this. Someone please help. I am creating stored procedures that queries the tables to pull certain information together in a listing (report). I would like to be able to print to the...
2
by: brown3313 | last post by:
I am new to this. Someone please help. I am creating stored procedures that queries the tables to pull certain information together in a listing (report). I would like to be able to print to the...
1
by: scottmachado | last post by:
I am currently running a marco that run a query and emails the results as an attachment in excel format. If the query has no records, I would like to email "no records found" in the first cell in...
5
kcdoell
by: kcdoell | last post by:
Hello: I am trying to write a code that will delete all records found in my DAO recordset Below is the code I have so far: 'Procdure to give the user the ability to delete all records 'for a...
1
by: RN1 | last post by:
Sub Page_Load(........) If Not Page.IsPostBack Then Call LoadData() End If End Sub Sub LoadData() Dim dSet As DataSet Dim sqlConn As SqlConnection Dim sqlDapter As SqlDataAdapter
1
by: Mr Key | last post by:
Hi all once again!!!! I have a database in .accde/.accdr format. The database has been designed using many relational tables. I set a form for deleting some records or all database. The problem...
9
by: ESAKKI109 | last post by:
In the attached image if I give input in the search criteria form it will bring the result in the query format based on input I key in . Incase if no records found after hitting RUN button how can I...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.