Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Datasets in different folders
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00488886
Message ID:
00489049
Vues:
11
>Larry, thanks for your reply. I think I understand waht you are suggesting.. to Put code into the BeforOpenTablesMethod of the dataenvioronment to change the cursor location. My problem with this is that the Dataenvironment cannot be subclassed.. does this mean I must amend every single form that I use. Is there anywhere in my Base Class (either the form or somewhere else)that I could do this, so that I need to do it only once and it can be subclassed?
>
>One other thing I cannot understand with the dataenvironment. In my development pc, say I set up a Form and in the dataenvironment the Database Cursor is set to C:\MYDir\MyDBc. I then copy the whole system out to the client into f:\Apps and , without any modifications on my part, the dataenvironment cursor reads f:\Apps\Mydbc. If its hard coded, how come it changes automatically ?
>
>Regards,
>
>Gerard

You can get away with putting the code in the Load event of the form by making a few changes.

1. Change the AutoOpenTables property to .F. for the form's DE.
2. Change the THIS reference to THIS.Dataenvironment where appropriate because THIS would refer to the form and not the DE.
3. Add a THIS.Dataenvironment.OpenTables() at the end of the FOR...ENDFOR loop.

This is essentially what Hiten gave you except that by changing the AutoOpenTables property, you don't need to issue a CloseTables at the beginning, because nothing will have opened yet and the DE will not have loaded.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform