Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Duplicate numbers
Message
From
16/03/2010 17:30:19
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01454921
Message ID:
01454959
Views:
40
>Shafid,
>
>You can use a record lock to insure the barcode number is not duplicated. Example code is below (untested just use as an example).
>
>
>LOCAL lnBarc
>SELECT barcno   && table with barcode number
>IF Barcno <= 0
>   MESSAGEBOX("This computer is not setup with barcode numbers","")
>   RETURN
>ENDIF 	
>DO WHILE NOT RLOCK()
>ENDDO
>lnBarc = Barcno.Barcno  
>REPLACE Barcno WITH Barcno+1  &&increase by one
>UNLOCK
>
Is it possible that another user would not see the updated value after you've done that or will everybody having the table open get a refreshed version when the lock is released?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform