First, why aren't you doing a SEEK to the correct record in the setup table? Do you have an index on the tablename field? If so, then check if EOF() or FOUND() and you can use IF SEEK() or better yet use
IF INDEXSEEK(m.cAlias,.T.,'SETUP',"TAGNAME") && change TAGNAME to index tag
to get to the correct record and trap for not finding it just as a precaution. Then, what happens if you change the replacement line to:
IF RLOCK('SETUP')
REPLACE setup.nextid WITH setup.nextid+1
UNLOCK IN setup
ELSE
ENDIF
Also, does it happen from your machine when you login as one of the other users? What type of network is it? What are the OS of the workstations (including yours)? If you issue in code:
IF SET('DEVELOPMENT') = "ON"
WAIT WINDOW SYS(5)+ALLTRIM(oVar.Sysdatapath) + 'SETUP.DBF'
ENDIF
What result do you get?
>Here's the code where it's blowing up:
>
>IF !USED('SETUP')
> USE ALLTRIM(oVar.Sysdatapath) + 'SETUP.DBF' IN 0 SHARED
>ENDIF
>
>SELECT SETUP
>
>LOCATE FOR ALLTRIM(TableName) == m.cAlias
>
>IF RLOCK()
> brow **this browse allows me to look at the table okay, everything looks in order
> REPLACE NEXTID WITH nextid + 1 IN SETUP ** this line is where the program bombs off *****
>
> nRetVal = SETUP.nextid
> UNLOCK
>ENDIF
.·*´¨)
.·`TCH
(..·*
010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"