>I've a multi-user app on which one user occasionally needs exclusive use of one table. If another user has that table open, the exclusive open fails with a 1977 error. So how can user A tell whether user B has that table open--without shouting across the room?
>
>If the above circumstance cannot be detected, could anyone offer a production-quality routine to trap the resulting error? To date, I've received only error 1977, but the message for 110 also sounds possible.
>
>An FPW26-based solution would also be of interest.
>
>TIA
>Porter Hart
The primitive trap is simple enough:
lErrorflag=.f.
cError=on('error')
on error lErrorflag=.t.
*** run your command here
on error &cError.
If lErrorflag=.t.
=messagebox('You got an error!')
*** do something here, you may use ERROR() function to show/analyze error number
Endif
The more sophisticated way is to put some code (e.g. to check error number) to object.error event (this event will be triggered when error happens within this object's event/methods).
Edward Pikman
Independent Consultant