While I have no experience with OleDb, in Visual FoxPro you need to initialize the random number sequence, with a negative seed. For example:
rand(-1)
for i = 1 to 100
? rand()
next
Omiting the first step will always produce the same sequence (if you restart Visual FoxPro in between, or convert it to an executable).
I don't know what would be the best way to invoke this in your situation.
>When using OleDb, from VB.NET, to get data from Visual FoxPro, I cannot get the random generation to work. Basically, if I execute this line from VFP, I will get the expected result. This means at every SQL result, I get a random record sequence order.
>
>
>SELECT TOP 10 RAND(),Video.Date,Video.Numero,Video.Title,Video.NoVideoT,Video.Notes_E,Video.Notes_F,Master.FirstName,;
> Master.LastName,Program.Title AS Program,Video.NoProgram,Video.NoClass,Video.Url;
> FROM Video;
> INNER JOIN Master ON Video.NoMaster=Master.Numero;
> LEFT JOIN Program ON Video.NoProgram=Program.Numero;
> WHERE Video.Date<=DATE() AND Video.Active;
> ORDER BY 1 DESC
>
>
>But, if this line is called from VB.NET by the use of the OleDb, I will always get 0.91 for the RAND() value. Is there a way to make that work in that environment?
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)