Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2002
    Posts
    20

    Angry Unanswered: limit nos of rows in drop-down box

    Dear All

    Does anyone have some code that will allow me to do the following:

    I have a SQL table that returns > 100 rows

    I want to put these rows into a drop-down (combo box) - I CAN DO THIS

    The problem I am having is that I only want to display x rows at a time

    I am able to do SET @@ROWCOUNT in my Stored Procedure - that's not a problem, but how do I display the rest of the results - will this be done using SQL code, or can I do this using vbscript, do I need to use @@ROWCOUNT?

    e.g. when the user first goes to the page they click the drop-down box and the first 30 rows are displayed, but how do I run the code to display the next 30 and then the next 30 etc....

    Thanks for your help

    Gill

  2. #2
    Join Date
    Mar 2003
    Location
    Atlanta, GA
    Posts
    191

    Re: limit nos of rows in drop-down box

    Originally posted by gleech
    Dear All

    Does anyone have some code that will allow me to do the following:

    I have a SQL table that returns > 100 rows

    I want to put these rows into a drop-down (combo box) - I CAN DO THIS

    The problem I am having is that I only want to display x rows at a time

    I am able to do SET @@ROWCOUNT in my Stored Procedure - that's not a problem, but how do I display the rest of the results - will this be done using SQL code, or can I do this using vbscript, do I need to use @@ROWCOUNT?

    e.g. when the user first goes to the page they click the drop-down box and the first 30 rows are displayed, but how do I run the code to display the next 30 and then the next 30 etc....

    Thanks for your help

    Gill
    I don't know if this applies to MS SQL, I work exclusively with Access databases... but in Access, the recordset object has a method called GetRows. Getrows has parameters one can pass to indicate the starting row, and the total number of rows to return into an array.

    I use this for navigating tables all the time.

    Maybe you already knew this and it won't work in your case, or maybe it's not something that can be done in MSSQL.

    Either way, Good Luck.

    Tim
    Tim

  3. #3
    Join Date
    Feb 2002
    Location
    North Wales, UK
    Posts
    114
    Yeah you really need to look at record sets especially paging.

    http://www.asp101.com/articles/recor...ging/index.asp
    J^ - web | email
    newsASP Developer

Posting Permissions

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