|
-
Nov 2nd, 2000, 08:43 AM
#1
Thread Starter
New Member
Is it possible to run a select statement, e.g "SELECT * FROM <TABLE>" where the table contains 100 rows, and only get for example 10 rows at a time?
I don´t want to fill my recordset with all 100 rows at once, I just want to fill it with 10 rows at a time and then empty the rs and fill it up with another 10 rows.
I´m going to create a searchfunction which returns 10 rows per page, like Altavista and so on. I have found out that filling the recordset with all rows at once could make it all rather slow.
-
Nov 2nd, 2000, 08:46 AM
#2
Frenzied Member
use ado's .pagesize, .pagecount. .absoluteposition
-
Nov 2nd, 2000, 12:50 PM
#3
Fanatic Member
....
SET ROWCOUNT 10
prior to running your query
-
Nov 2nd, 2000, 02:49 PM
#4
Frenzied Member
Set rowcount will not do it. Because it will return the same 10 rows each time.
Set rowcount is usefull if you want to get a sample of the data.
Kovan's correct, the pagesize (which is 10 records by default by the way), pagecount, and absoluteposition properties are what your looking for..
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Nov 2nd, 2000, 03:16 PM
#5
Monday Morning Lunatic
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Nov 3rd, 2000, 11:16 AM
#6
Fanatic Member
Fine if you aren’t using DAO…
Funnily enough, I have to do a similar process, but using Access97 only. Although I haven’t started, I expect my approach will be using bookmarking in recordsets
Gaffer
-
Nov 3rd, 2000, 02:35 PM
#7
Fanatic Member
...
Sorry... I misread the question
-
Nov 4th, 2000, 10:17 AM
#8
Hi, how about this for an idea...
"Select * from <table name> where id >= 1 and id < 10"
After this i would store my last id into a temporary variable and then use this value in my subsequent query
"Select * from <table name> where id >= " & myvariable & " and id < " & myvariablevalue + 10 & "
Should be something similar to this...
Sorry if this doesnt help you...all the best...vijay
-
Nov 4th, 2000, 10:47 AM
#9
Monday Morning Lunatic
Use this:
Code:
SELECT * FROM table LIMIT 0, 10
SELECT * FROM table LIMIT 10, 20
...and so on.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Nov 6th, 2000, 01:41 PM
#10
Fanatic Member
hi
does not on SQL server though
-
Nov 6th, 2000, 02:41 PM
#11
Frenzied Member
like i said in my original post
use the ADO .pagesize, .absoluteposition and .pagecount
very simple..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|