*loop through the records you need to update and update each one individually IF RLOCK() && lock just the record ** do my stuff UNLOCK ELSE && record is locked by someone else ** you need to trap for this and take the appropriate action: keep trying, log error, or whatever you decide is appropriate ENDIF *If RLOCK() fails everytime, then something has the table locked or opened exclusivelyor try using tableupdate with or without transactions with something like:
LOCAL tupdatemrecno && current record pointer location IF ALIAS()<>"TEMPLCONTROL" SELE TEMPLCONTROL ENDIF STORE RECNO() TO tupdatemrecno IF CURSORGETPROP("Buffering",'TEMPLCONTROL')=5 && optimistic table buffering ok BEGIN TRANSACTION llOK = TABLEUPDATE(1, .F., "TEMPLCONTROL") IF llOK END TRANSACTION ELSE ROLLBACK =TABLEREVERT(.T., "TEMPLCONTROL") MESSAGEBOX("An error occurred, please make your change again.",16+4096) ENDIF ELSE SELE TEMPLCONTROL llSuccess=CURSORSETPROP("Buffering", 5, "TEMPLCONTROL") IF llSuccess != .T. =MESSAGEBOX("ERROR! Could not set buffering mode on temporary table!",0+4096,"Please exit this form and try again.") ELSE BEGIN TRANSACTION llOK = TABLEUPDATE(1, .F., "TEMPLCONTROL") IF llOK END TRANSACTION ELSE ROLLBACK =TABLEREVERT(.T., "TEMPLCONTROL") MESSAGEBOX("An error occurred, please make your change again.",16+4096) ENDIF ENDIF ENDIF IF RECNO()<>tupdatemrecno GOTO tupdatemrecno ENDIFIt just dawned on me (sorry) that you are inserting. The table header has to be updated temporarily in order to update the record number (rowcount) (even append blank will do that). I would research what else has the table or table header locked in the other app...