Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How is done?
Message
From
14/07/2001 23:51:33
 
 
To
13/07/2001 16:36:11
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Miscellaneous
Thread ID:
00530503
Message ID:
00530748
Views:
13
>I'm experimenting with some COM stuff. I want to build a VB customer form with about 10 textboxes on the form. The Save button on the form would loop through the textboxes and pass the values in them to the VFP COM object. And the COM object vaildates the data and saves it to the customer table. My problem is what is the best way (generically) to map each textbox to the correct fields in the customer table?
>
>smith

Chris,

There are a couple of ways to do this. One of the most popular is to create a business object class. This class has a property for each attribute of the bizobj (table). You would instantiate this bizobj and set each property to your value. The bizobj would also have method like save, get, add, etc which would save the values in the properties to the record, or get the values from a record an put them in the properties.

Another way you can do this is using XML, send an XML string to an update method... the XML would contain info like the primary key and the values of the fields to update, the COM object would read the XML and do the correct data manipulation. One of the best VFP XML gurus is Rick Strahl and he has an article on distributed computing with XML on his web site at www.west-wind.com.

BOb
Previous
Reply
Map
View

Click here to load this message in the networking platform