Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Uniq ID number for fields in table in single and network
Message
From
06/11/2001 02:35:05
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Uniq ID number for fields in table in single and network
Miscellaneous
Thread ID:
00577811
Message ID:
00577811
Views:
88
Hi to all,

I have one free table which has one field with value which should automatic rise up from 1 to endless (999999) like uniq identifier of each records (like Autonumber in Access) and in order to solve this I put this code in Valid Events of cmdAdd commandbutton (from buttonset1 group):
LOCAL br
if this.parent.addmode=.f. then
wait wind 'Saved...' at 20,10 nowait
DIMENSION maks(1)
IF RECCOUNT()=1 then && was just 1
br=1
ELSE
SELE MAX(n_rok) FROM nrok INTO ARRAY maks
br=maks+1
ENDIF
repla nrok.n_rok with br
=tableupdate(.t.)
endif

if this.parent.addmode=.t. then
wait wind 'In mod for input' at 20,10 nowait
endif
thisform.refresh
*------
I have fear that in multiuser environment could happen that both user get same value for their new records or that could be duplicate possible.
Is there any better and for sure solution?
Thanks in advance
Elvir
Next
Reply
Map
View

Click here to load this message in the networking platform