Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unable to get random generation with OleDb
Message
From
17/09/2006 18:44:24
 
 
To
17/09/2006 18:29:51
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01154512
Message ID:
01154515
Views:
10
>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) && Initialize random sequence, based on system time
>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.

That's the problem. In OleDb, each call is within in its own environment. Thus, that's why it always gives the same result. I don't know how to adjust the SQL so within it, such command could be invoked.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform