Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Control opening of remote views in a form's DataEnvironm
Message
From
16/09/2023 01:40:21
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
15/09/2023 13:58:36
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01687065
Message ID:
01687067
Views:
69
>I've always developed my Client/Server applications using my forms' DataEnvironments (private), and these DE's have remote views on them, so when the forms are run with DO FORM the remote views al automatically opened with all its defines properties (like NoDataOnLoad, Buffering, etc.).
>
>Is there a way that I can open those remote views "manually"? That is, instead of the remote views being opened automatically by the Data Environment, they, by somehow reading the Data Environment, can be opened manually by code (e.g. using the USE command or some function defined by the user), allowing me to, for example, change the connection using the CONNSTRING clause of the USE command, or use TRY...CATCH...END when each remote view is opened, among other things.

The usual place for this is either the DE's .init() (if you mean to keep the DE) or in the form's .load() (because it executes before anything else, specially before the bound controls are instantiated, so you get the datasources ready before they are).

Of course, you'd need to remove the cursor objects from the DE, so the views don't get opened twice, and (as I'd recommend) remove the DE altogether. Having code in any of the DE's events was always a black hole to me - if anything ever creates a bug there, it's hardest to find, because it's in its separate space, out of sight and easily forgotten.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform