IT Employment

General discussion


How do i retrieve a record from a database randomly?

By hoxt ·
Hi, I am developing a test ingine to run online testing software and i have one problem, i just cant seem to load the questions randomly from the database so that the exams dont look similar everytime they are loaded. can someone please help?

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -


by WilliamSanders In reply to How do i retrieve a recor ...

write a vfp component that handles your randomization.

regards [Bill]

Collapse -

Simple solution

by fred_krampe In reply to How do i retrieve a recor ...

use the random number generator (which generates a number between 0 and 1)and combine with the max record in the table.

See my example (not tested) below:
Use myTable

** init randomizer

** set the number of questions to ask
nAsk = 20

For i = 1 To nAsk

nRec = Int(Reccount()* Rand()) + 1

Go nRec


Related Discussions

Related Forums