If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > limit nos of rows in drop-down box

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-17-03, 06:00
gleech gleech is offline
Registered User
 
Join Date: Dec 2002
Posts: 20
Angry 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
Reply With Quote
  #2 (permalink)  
Old 06-19-03, 01:35
MrWizard MrWizard is offline
Registered User
 
Join Date: Mar 2003
Location: Atlanta, GA
Posts: 191
Re: limit nos of rows in drop-down box

Quote:
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
Reply With Quote
  #3 (permalink)  
Old 07-01-03, 04:46
JonathanB JonathanB is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On