Mensaje
 
a
16/03/2010 15:27:43
General information
Foro:
Visual FoxPro
Category:
Bases de datos, tablas, vistas, índices y SQL
Título:
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
ID de la conversación:
01454921
ID del mensaje:
01454924
Views:
60
>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

You need to lock the record before attempting to change.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Responder
Mapa
Ver