>>Hi Francois!
>>
>>You can save your form as class and use the following code:
>>
>>loForm=createobj([waitform])
>>loForm.Show()
>>=sqlexec(blah blah blah)
>>loForm.release()
>>
>>>In the first example
>>>
>>>do form MyPleaseWaitForm &&
>>>sqlexec(myconnection,"select * from ...)
>>>
>>>Fox does start the SQLEXEC command before completing FORM OPENING.
>>>The form is only completed once the SQLEXEC is finished ! not nice*
>
>
>Hi Vlad,
>
>I take your point. I tested it. But the problem still occurs if you use class instanciation rather than forms.
>
>From my experience what happens indeed when you do a FORM Show() :
>
> 1 - Fox shows the frame of the form (whether VCX or SCX)
> 2 - goes on with the rest of the fox code,
> 3 - in PARALLEL to step 2 goest its own way loading the controls.
>
>VFP uses that trick to improve form-rendering. You hardly notice it. When that code is pure VFP grammar, that generally works pretty fine.
>
>But in some situation line1 completion of code should be guaranteed before you step into line2.
>
>When that line2 is a blocking async SQLEXEC you need to resort to tricks if you want your UserPleaseWaitForm.show() to show before the async SQLEXEC is finished (not only the frame but all controls).
>
>I did insert =INKEY(1). I am really unsatisfied with the solution but sometimes turning fox around is the only way.
>
>If anyone ran into equivalent difficulties : fox being kind of too fast, i'd be glad to share experience!
>
>
>Regard
I see two more solutions:
1. Run SQLExec from Form.Activate event.
2. Have MyPleaseWaitForm form available all time (hidden) and bring it up (very quickly) when it's necessary.
Edward Pikman
Independent Consultant