Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

row output

Status
Not open for further replies.

cjkenworthy

Programmer
Sep 13, 2002
237
GB
I have a function to generate 3 random numbers. I want to use these numbers to randomly output rows from a database table.

so if my numbers are: 23, 670, 207 I want output (using AD0) these row numbers from a recordset called "NGNs"

I know that the random numbers are set to not be greater than the number of rows in the table.

I'm not sure how to manually output only specific rows.

Any help would be appreciated.
 
You could go through your recordset with a counter...

counter = 1
do while not objrs.eof
if Counter = rand1 then ....
if Counter = rand2 then ....
if Counter = rand3 then ....
counter = counter + 1
objrs.movenext
loop -- Just trying to help...
[wolf]<--- This is a wolf? We need a new icon.......
mikewolf@tst-us.com
 
Use

NGNs.movefirst
NGNs.move 23

You can either move first every time or just move the different to the next record.
syntax: recordset.move Number Of records, [start]

NGNs.movefirst
NGNs.move 670

or

NGNs.move 670-23, 23

or use absolutePosition

NGNs.AbsolutePosition = 670

or

NGNs.moveAbsolute(670)
Thanks,

Gabe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top