TRY USE mytable EXCL CATCH TO oErr WHERE oErr.ErrorNo = 1705 * Table is in use by someone else ENDTRY IF USED("mytable") && table is open exclusevly, proceed * Do whatever ENDIF>Adjusted to restore previous ON ERROR setting...
>>local llFileError, lcOldError >lcOldError = on("error") >>ON ERROR llFileError = .T. >>use MyTable >>ON ERROR &lcOldError >>if llFileError >> MessageBox("Can't open table.") >>else >> (Continue processing) >>endif >>>>