By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,660 Members | 1,593 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,660 IT Pros & Developers. It's quick & easy.

How to limit number of records found a query

P: 4
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
Share this Question
Share on Google+
3 Replies


ADezii
Expert 5K+
P: 8,652
Why not use the SQL SELECT Top Clause?
Sep 17 '16 #2

P: 4
I tried to get that to work with no luck
Sep 17 '16 #3

P: 4
Ok thanks I got it to work
Sep 17 '16 #4

Post your reply

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