Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
When is a form's DataEnv loaded in rela to form events?
Message
 
To
16/11/2006 15:04:25
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01170449
Message ID:
01170456
Views:
6
>I am working on designing one of my first forms - yes I'm a newbie :) I put some code in the form's Init event, expecting the data enviromnent to be established at that time. I put a WAIT WINDOW command just after my code in form's Init, and the Data Session window did not show the data enviroment loaded with all the free tables specified in my form's DE. Oddly, on the next line (in Init) I did a SUSPEND. After suspending, the data environment is fully loaded. Maybe you can't truly suspend VFP in the form Init, as possibly some other events/methods fire before fully suspending?
>
>So my question is when does a form's DE get loaded, in relation to the many events/methods of a form?
>
>TIA,
>
>-Mike
>
>PS. Can anybody tell me why every time I post a new message to this Visual FoxPro forum, the drop down Category list contains non-VFP categories. I have to click Send, then get a message that I selected a nonexistent VFP category. Maybe this is a glitch because I use FireFox?

Here the events sequence as it described in VFP HELP:
Object                     Event that occurs  
--------------------------------------------
Data environment           BeforeOpenTables
Form set                   Load
Form                       Load
Data environment cursor(s) Init 
Data environment           Init
Objects                    Init 
Form                       Init
Form set                   Init
Form set                   Activate
Form                       Activate
Object1                    When
Form                       GotFocus
Object1                    GotFocus
Object1                    Message
Object1                    Valid 
Object1                    LostFocus
Object2                    When
Object2                    GotFocus
Object2                    Message
Object2                    Valid
Object2                    LostFocus
Form                       QueryUnload
Form                       Destroy
Object                     Destroy
Form                       Unload
Form set                   Unload
Data environment           AfterCloseTables
Data environment           Destroy
Data environment cursor(s) Destroy
But to be sure that DE is opened you tables you must check if you set AutoOpenTables property of DE to .t.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform