Ask a Question related to ASP Database, Design and Development.
-
Dave Karmens #1
Display x number of records
How could I display *only* x# of records even if the select statement
returns a value >x?
Dave Karmens Guest
-
retreve number of records updated
is there a variable that can be accessed from a query that tells the number of records updated? Thanks KES -
How do I report the Total number of Records?
I am returning a list of records from a database via the XML Connector component, and then into a Dataset (and on into a Datagrid). How do I report... -
Total number of records
When I do a query, how do I get a total number of records found to appear at the bottom of the screen? Thanks -
Limited number of instert records
Hi - Using ASP/Access/Vbscript Is it possible to set a limit of for example 6 insert records of the same type in the DB? Have a product database... -
number of records
hello sir, thank u for help in advance i want to know as to how i can get the number of records obtained in the result of a select query ,the... -
Raymond D'Anjou \(raydan\) #2
Re: Display x number of records
Select top 10
or
SET ROWCOUNT @x
select ... from tableName ...
"Dave Karmens" <spam_just1coder@yahoo.ca> wrote in message
news:OiD%23a7lIEHA.3200@TK2MSFTNGP10.phx.gbl...
> How could I display *only* x# of records even if the select statement
> returns a value >x?
Raymond D'Anjou \(raydan\) Guest
-
Bob Barrows [MVP] #3
Re: Display x number of records
Dave Karmens wrote:
Several options, starting with the best:> How could I display *only* x# of records even if the select statement
> returns a value >x?
1. Modify the query to only return the number of records you wish to display
2. When using GetRows to stuff your recordset's data into an array, supply
the argument to tell the function to only put x records into the array.
3. Count the records as you write them to the Response object, stopping when
you've reached the xth record
For more information, search for recordset paging at aspfaq.com
HTH,
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Bob Barrows [MVP] Guest
-
Ray at #4
Re: Display x number of records
Why not just select x# of them?
select top 40 ......
And if for some reason you still want to return them all, then the answer
depends on how you're currently displaying them. Are you just looping
through your RS? If so, you could do:
Dim i
i = 0
do while not rs.eof
''your code that displays record
i=i+1
If i = 40 then exit do
rs.MoveNext
Loop
Ray at work
"Dave Karmens" <spam_just1coder@yahoo.ca> wrote in message
news:OiD%23a7lIEHA.3200@TK2MSFTNGP10.phx.gbl...> How could I display *only* x# of records even if the select statement
> returns a value >x?
Ray at Guest
-
Dave Karmens #5
Re: Display x number of records
that's it:
Thanks Ray.> i=i+1
> If i = 40 then exit do
Ray at <%=sLocation%> [MVP] wrote:
> Why not just select x# of them?
>
> select top 40 ......
>
> And if for some reason you still want to return them all, then the answer
> depends on how you're currently displaying them. Are you just looping
> through your RS? If so, you could do:
>
> Dim i
> i = 0
> do while not rs.eof
>
> ''your code that displays record
> i=i+1
> If i = 40 then exit do
> rs.MoveNext
> Loop
>
> Ray at work
>
> "Dave Karmens" <spam_just1coder@yahoo.ca> wrote in message
> news:OiD%23a7lIEHA.3200@TK2MSFTNGP10.phx.gbl...
>>>>How could I display *only* x# of records even if the select statement
>>returns a value >x?
>
>Dave Karmens Guest
-
Bullschmidt #6
Re: Display x number of records
What's after TOP? by graz - 8/31/2000
[url]http://www.sqlteam.com/item.asp?ItemID=566[/url]
Best regards,
J. Paul Schmidt, Freelance ASP Web Consultant
[url]http://www.Bullschmidt.com[/url]
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Bullschmidt Guest



Reply With Quote

