|
-
March 4th, 1999, 05:32 PM
#1
random posts?
I doing a program in visual basic,but I have some problem with Randomize.I wonder if someone know how to do if you have a database and want the program to pick random post from the database and show them in a text field when you push a button.
Thanks for your time.
Mario Gustavsson
-
March 7th, 1999, 03:53 PM
#2
Re: random posts?
Radomize and rnd function together generate psuedo-random number. It's between 0 & 1 .
Check number of records in DB. say n,
Int((n * Rnd) + 1) ' Generate random value between 1 and n.
Now open recordset and do MoveNext for n-1 times. This may not be a appropriate for large number of records though.
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
|