How to limit number of records found a query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dlbdennis
    New Member
    • Mar 2007
    • 4

    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.
    Code:
     strSQL = "SELECT * FROM TABLE WHERE "
          
          for x = 0 to UBound(arrParams)
             if arrParams(x, FIELD_MINVAL) <> "" or arrParams(x, FIELD_MAXVAL) <> "" then
                if x > 0 and strSQL <> "SELECT * FROM TABLE WHERE " then
                   strSQL = strSQL & " AND "
                end if
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    Why not use the SQL SELECT Top Clause?

    Comment

    • dlbdennis
      New Member
      • Mar 2007
      • 4

      #3
      I tried to get that to work with no luck

      Comment

      • dlbdennis
        New Member
        • Mar 2007
        • 4

        #4
        Ok thanks I got it to work

        Comment

        Working...