Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Duplicate numbers
Message
 
 
To
16/03/2010 15:27:43
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:
01454925
Views:
50
Here is the standard way of approaching this problem

Re: Primary Keys Thread #441081 Message #441087

>Help. . . I have a little table which provides the next barcode number but I can't stop getting a duplicate number over the network. Sometimes when two or more people are using the system and generating new barcodes, we get duplicate numbers. Here is my barcode numbrs code :
>
>
>local nBarc
>select barcno   && table with barcode number
>nBarc=barcno.barcno  
>IF nBarc <= 0
>	MESSAGEBOX("This computer is not setup with barcode numbers","")
>	RETURN
>ENDIF 	
>replace barcno with nBarc+1  &&increase by one
>FLUSH in barcno force   
>IF USED("barcno")    && clos the table
>	USE IN barcno
>ENDIF
>IF NOT USED("barcno")  && open the table 
>	SELECT 0
>	USE barcno
>	
>endif		
>
>
>Any quick fixes ???
>Cheers. Shafid
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform