Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Entry using COM BizObj
Message
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Title:
Data Entry using COM BizObj
Miscellaneous
Thread ID:
00266930
Message ID:
00266930
Views:
48
Below is a scenario I tried to run using MM framework ver. 6.0. Client environment is VFP6. The User BizObj below is using a single record view from the user table.

1. A BizObj is instantiated from an in-process DLL
oapp = CREATEOBJ("TestApp.AppCOM") && DataFormat is set to 1 - ADO
ox = CREATEOBJ("TestApp.UserObj")

2. New empty record is added and new ID is assigned.
ox.New()

3. Empty record is retrieved to client.
oRS = ox.GetData()

4. Data is filled on the client
oRS.Fields("cFullName") = "Joe Foo"

5. Data is sent back to BizObj
ox.SetData(oRS)

6. Data is saved to the database
ox.Save()

7. BizObj is released
RELEASE ox

Question 1: This code works, but it skips every second ID. For example, adding 5 records using the code below produce IDs 2, 4, 6, 8, 10. If I append these records manually to the table, then everything is OK. Also, there is no default field value is filled for ID field in the view.
Question 2: BizObj calls DBF2RS() in GetData() method, which SCANs the view and automatically updates the table with all empty fields because the view is using default row buffering setting. This function also uses the GOTO statement that does the same thing.
Question 3: No error is generated from the BizObj.GetData() under COM indicating that new empty record cannot be posted. At the same time, the error "Cannot add empty record" is generated by VFP if I try to run the same BizObj with the same ADO setting as VFP class.

I have read the manual, but there is no practical info or examples about how to actually use the framework in COM environment.

Thank you for your time.
Serge Matsevilo, Seattle, WA, USA
Senior Programmer/Analyst,
iServ Systems, Inc.
e-mail: smatsevilo@iservsystems.com
Next
Reply
Map
View

Click here to load this message in the networking platform