>>I addded the following code to dataenvironment.Error method.
>>Why this code fails: all cursor objects exists but used() returns .f. always!
>>How to dedect the table causing an error ?
>>
>>
>>LPARAMETERS nError, cMethod, nLine
>>
>>LOCAL i, aCursors[1], cLastAlias
>>AMEMBERS(aCursors, thisForm.DataEnvironment, 2)
>>
>>nUsed = 0
>>
>>FOR i = 1 to ALEN(aCursors)
>> WITH EVAL("thisForm.DataEnvironment." + aCursors[i])
>> IF lowe(.BaseClass) != "cursor"
>> loop
>> endif
>> if used(.Alias)
>> nUsed = m.nUsed + 1
>> endif
>> ENDWITH
>> endfor
>>* nUsed==0 here always.
>>
>
>Looks like worst-case scenario, or is it the very first table which gives you the error?
> One thing I wanted to try with this is to hide the 7th table and see if Cursor7 would be the one giving the error. Do this on something that otherwise works, so I'd know it's regularly detecting the introduced error.
It is not a first table. I used some of tables exclusively in
other vfp command window. In DE Error event, no one table is opened!
>Another thing to try - check if any of these tables can be USEd while still in the error method, and see what error you get if you try.
It seems simpler to set autoopentables .f. , loop
through DE cursors in Form Load event and open them manually.
I dont use any DE events. It this exactly the same as letting
form itself to open all tables ?
Andrus