>Hi
>
>>That's why you need an error trapping procedure. That's basically the only way to find, if the table could be opened excusively or not.
>
>I just gave your code a try but it seems that the class/form takes the error responsibility so the following line raises an error in the CodeBook framework rather than the error number being assigned to lnErr=ERROR()
>
> USE (m.tcTable) AGAIN &tcMode IN 0 ALIAS (m.tcAlias)
>
>Please advise, how can I let your function handle the error rather than passing it up he heirarchy?
Bhavbhuti,
I checked the code and it already have bugs in itself (sorry Nadya). ie:
if !used(m.tcAlias) ...
Is never a guarantee that table is not in use (Nadya remember alias might not be the same as tablename). Plus table might be in use with or w/o same alias name in another session. Code not looping sessions if I didn't miss it.
use (m.tcTable) again &tcMode in 0 alias (m.tcAlias)
Having tcMode as EXCLUSIVE doesn't guarantee you opened it in exclusive mode. It might be opened as shared and no error shows up (bug,feature?). ie:
use employee shared
use employee again exclusive in 0 alias e1
? Isexclusive('employee'), IsExclusive('e1')
"AGAIN" there is introducing an implicit logical error that you can't catch w/o checking.
Cetin