Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Save DataEntry form as Class
Message
De
25/03/1998 14:54:24
 
 
À
25/03/1998 14:30:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00087108
Message ID:
00087115
Vues:
28
>This is my first attempt using classes for something other than saving template forms and controls. I.m trying to save my data entry form (with DataEnvironment, I wish) as a Class. Saving the form is successful. BUT how do I reattach (So to speak) the data environment. When I issue an oTimeSheet=CreateObj('frmTimeSheet'), I get an error about the data environment missing.
>
>Please help, the documention is a bit confusing on this topic.

Normally Class doesn't contain DE, however you can add one programmatically. I don't use this way but the idea is following:
1. Create new class property 'oDE'
2. Add to Class.Load event
thisform.oDE=createobject("dataenvironment")
thisform.oDE.addobject("cursor1","cursor")
thisform.oDE.addobject("cursor2","cursor")
.....
thisform.oDE.cursor1.database="d:\vfp5test\data1.dbc"
thisform.oDE.cursor1.cursorsource="table1"
.....
thisform.oDE.opentables
2. Add to class Unload/Destroy event
thisform.oDE.closetables
this.oDE=.NULL.
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform