>>There's the error event of the DataEnvironment - where you could parse the cursor objects and check which is the first one which refused to open. But then, this is sort of equal to manually creating your DEs, because you'd have to insert this code into the DE of every form you already have, or create your own DE class and then instantiate it for each of your forms. Writing a builder to do this shouldn't be too hard, but then you could just write another one which would insert the error checking code into all of your .scx files DE methods.
>
>I'm ready to add a call to generic method into all of my DE
>Error methods.
>
>In Error method, the cursor object does not exist since it cannot be
>opened.
>How can I determine then name of this cursor in Error event?
>Must I open .scx file, find first unopened cursor and assume that
>this is the cursor causing error? Or is there some simpler way?
The cursor and relation objects exist during the BeforeOpenTables - put any code there, and you will find them.
I don't have the code here, but manipulating cursors in BeforeOpenTables involved something like
n=amembers(aarray, this, 2)
for i=1 to n
oObj=aarray[i]
if oObj.BaseClass='Cursor'
[ your code here, involving oObj.Alias etc]
endif
endfor
I'm assuming you can use something like that in the Error method. You can actually run something like "Do DEErrorCheck with This" and have the code not repeated in each DE.
If you're still not seeing anything (i.e. you get n=0), I've probably run out of tricks... until tomorrow.