Limit to # rows question.

Results 1 to 2 of 2

Thread: Limit to # rows question.

  1. #1
    Join Date
    Dec 1969

    Default Limit to # rows question.

    I am using the following statements within ASP, but the code is not working:<BR><BR>&#060;%<BR>Dim Numrows<BR><BR>Numrows = request.form ("numrows")<BR><BR>select * from table limit to &#039;"&Numrows&"&#039; <BR>%&#062;<BR><BR>numrows is populated by a dropdown menu from the page that calls this ASP page. Its initial value is set to 50. This seems like a no brainer. Is there something that I&#039;m missing? The rows get returned, but the limit to does not work.

  2. #2
    Join Date
    Dec 1969

    Default RE: Limit to # rows question.

    What DB is this??? But, in any case, why would you put &#039;...&#039; around a *numeric* value. That seems wrong to me, no matter what kind of DB.<BR><BR>In SQL Server and Access, you&#039;d do that same thing with:<BR><BR>SQL = "SELECT TOP " & Numrows & " * FROM table ..."<BR><BR>You can also accomplish essentially the same thing by setting the ADODB.RecordSet.MaxRecords property *before* you open the Recordset object.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts