-
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
-
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.