Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Avoiding Dublicate Field entries in a multi-user applica
Message
From
26/02/1998 19:50:47
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
25/02/1998 17:51:57
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00080125
Message ID:
00081569
Views:
37
>Sys(3) is suitable for a random filename - filenames are not created in con >secutive milliseconds. For keys, no. > >Do you have a suggestion? > I can only repeat what you can find in numerous threads on the matter here - either use a separate table to keep the last values of PK's for each table, using mechanism like the NewID procedure in the TasTrade example, or use a combination of stationID+datetime(). There's a function which gives a string based on milliseconds, sys(2015) or something near to it. I've used this (the ib is internal key field; in this case it was used for synchronizing two records in master and subdirectory tables, i.e. it had to be unique) repl ib with subs(sys(2015),2) * and a stupid empty loop until the next millisecond do while sys(2015)="_"+ib endd In your case it would be this IB preceded with stationID. It's based on an assumption that one machine may generate this key only once - and we can wait until the millisecond's end to make sure it's unique.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform