Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Newbie w/Data environments with forms question
Message
 
 
À
20/07/2001 10:15:25
Scott Starkey
Tindall Record Storage
Fort Worth, Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00533120
Message ID:
00533130
Vues:
16
>Can a form that has a specific table in a data environment be used in two different applications? I am using a different directory for a new project and want to use the same form. I have the same table name in a separate directory from the original application. Can I just SET DEFAULT TO directory in some controlling program and then the form will display different data? I have tried SET DEFAULT TO in the my main program, but it seems to be looking at the original data still.

Yes you can as long as EXCLUSIVE is OFF. You need to look at SET DATASESSION in the VFP help to see all the different parameters that are scoped to each data session. One of these is SET DATABASE TO. When you drop a table into the DE of a form, the relative path to that table is stored in the SCX. Try putting SET DATABASE TO MYDBC in the BeforeOpenTables of the DE.

I also have a StripPath.prg utility code that I run to strip the relative paths from the cursors in the the DE. You can do this by opening the SCX with the USE command, look for records that are cursors, then modify the Properties field and remove the relative path. Then close the table and recompile the form.
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform