PROCEDURE OpenExclusive(tcAlias as String) as Boolean local llRetVal llRetVal = .T. if used(tcAlias) select (tcAlias) else select 0 endif TRY use (tcAlias) exclusive CATCH *-- nope! llRetVal = .F. ENDTRY return llRetVal ENDPROCthen You can call it
if OpenExclusive("Test") *-- do my exclusive stuff else *-- display a message or do something different endifOh, and if You do not Have VFP 8+ You'll need to do something like this instead of the try..catch
*-- disable the ErrorHandler lcWasError = on("ERROR") on ERROR * .... use (tcAlias) exclusive llRetVal = used(tcAlias) *-- and reEnable the ErrorHandler on error &lcWasErrorHTH