Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A FAQ on data objects and forms
Message
From
07/02/2001 13:57:39
 
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00473275
Message ID:
00473517
Views:
18
>I'm at the beginner stage of dealing with data objects.
>I'm using the object library written by Barry Brittenham as a template, which creates a data object in a class that accepts the name of the database and table as parameters with the statement in the GetData procedure:
>
>SCATTER NAME oRecord
>
>In the form class LOAD:
>
>SET PROCEDURE MyLibrary ADDITIVE
>
>The ControlSource property of the text controls is set at runtime in the form class INIT:
>
>WITH THIS
> .TxtFirstName.ControlSource = cDataObj + cFldFName
>ENDWITH
>
>The value for the constants cDataObj and cFldFName is set in an .h file:
>
>#DEFINE cDataObj "THISFORM.oPatient.oRecord"
>#DEFINE cFldFName "Last_Name"
>
>where 'Last_Name' is the actual name of the field in the table.
>
>My Question: is this a []good []poor []totally unrecommended way of assigning ControlSource and other properties to controls? What I've read so far on the UT and VFUG and FP Advisor has been a bit abstract. Any ideas or FAQs on the subject would be enormously appreciated.
>

IMO, the idea of using a data object on local VFP data overcomplicates things. Accessing your data through a SCATTER NAME object doesn't buy you much (if any) functionality. You might start your question by laying out what you want to accomplish, rather than stating that you have already decided to use 'data objects', and asking how. IOW, the decision to use data objects might not always be the wisest choice. Remote data is another story, for which the answer you might be looking for is ADO...

My .02
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform