Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form DE vs. Load event
Message
De
01/02/2006 02:50:35
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
31/01/2006 23:25:01
Alan Harris-Reid
Baseline Data Services
Devon, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Divers
Thread ID:
01092186
Message ID:
01092223
Vues:
16
>I have quite a large application (VFP8 front-end, SQL-server back-end) in which I now find I require to use alternative databases for some forms, but only for some clients. Up to now many remote-view cursors have been dragged from the database designer into the form DE, but that brings with it a hard-coded path to the database container the view was dragged from. As far as I can see, if an alternative dbc is required I will have to change the .database property of each cursor at runtime, but I think a neater way will be to open each view explicitly in form.load(), preceded by SET DATABASE TO (MyDBC).
>
>Apart from losing the 'visual' aspect of viewing tables/cursors in the form DE at design-time, are there any other disadvantages of opening cursors manually in form.load()? I can still set indexes, relations, etc. in code, but I want to make sure I don't miss anything before I make this change to many forms.
>
>TIA,
>Alan

You might miss milliseconds which is not a big deal.
Compared to SQLExec(), RV's already make it more 'visual' and I wouldn't sacrifice DE for this (and that might lead to unintentional errors - ie: set database is not a safe way to make it, Check recent threads about it).
Instead of manually coding it all in load just to change database, you might as well do it in DE.BeforeOpentables. Check for sample code with eywords 'BeforeOpenTables,amembers,cursorsource'.
Basically what you do is to call an external routine from form.DE.BeforeOpenTables. That routine loops all cursor members and sets correct database,cursorsource based on oApp.properties.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform