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 11:20:42
 
 
To
06/11/2001 02:35:05
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00577811
Message ID:
00578023
Views:
22
As Cetin said, you can use the routine on my website.


>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
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Reply
Map
View

Click here to load this message in the networking platform