Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Control opening of remote views in a form's DataEnvironm
Message
From
20/09/2023 14:45:26
 
 
To
20/09/2023 14:35:01
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01687065
Message ID:
01687079
Views:
41
>>>>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.
>>
>>Thanks for your time Dragan. And, yes I try to keep the DE, because that give me the chance to drag fields and build the form at design time, to me that's a very big time saver. Well, DE's Init() would give me the solution, I'll try whether it works. I'll let you know.
>>
>>On the other hand, what would be the best approach in order to replace the use of forms' DEs with remote views, but giving me the ease of building the form by dragging the fields at design time?
>
>You can drag fields from the Database Designer (the window opened by MODIFY DATABASE). Also from the Data Explorer.
>
>Tamar

Oh! Yes! Thanks for making me remember it. I really do it some times (but I don't remember why). And yes it works too. But my last question was more oriented for someone to give me some hint, but using Cursor Adapters.

Luis
Previous
Reply
Map
View

Click here to load this message in the networking platform