Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Save DataEntry form as Class
Message
From
25/03/1998 14:54:24
 
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00087108
Message ID:
00087115
Views:
27
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform