Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XMLUPDATEGRAM( ) Function Remarks
Message
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Product Documentation
Miscellaneous
Thread ID:
00703444
Message ID:
00703685
Views:
18
Hi Brian,

>From VFP7 help, XMLUPDATEGRAM( ) Function, Remarks:
>You should specify the key field list by issuing CursorSetProp( ) with a KeyFieldList clause against existing cursors and tables before issuing XMLUpdateGram( ). If you specify no key fields, both before and after representations will contain all the fields in the table. If you specify one or more key fields, only those fields will appear in the 'before' section. Use the CursorSetProp( ) function to avoid possible errors generated by XMLUpdateGram( ) on tables containing Memo or General fields.

>Even if the KeyFieldList is set to the appropriate key field(s), the modified fields still appear in the 'before' section of the updategram, not just those specified in the KeyFieldList.

That's the way XMLUPDATEGRAM() works.

>Since the WhereType property can only be set for view cursors, perhaps the line above should be updated to read:
>If you specify one or more key fields, only the key and modified fields will appear in the 'before' section when using cursors not based on views.

I haven't worked with the function on view cursors, but for cursors created with CREATE CURSOR or XMLTOCURSOR() it is true, what you say. The documentation of the function lacks some details. I find the last sentence not really understandable as well.

BTW: I use XMLUPDATEGRAM() in my current project but even setting the KeyFieldList, the function suddenly stopped including memo fields in the Updategram. This was verified by a friend on another machine. No idea, why it stopped doing this. Maybe it has something to do with the Upgrade to MSXML4 or whatever. So if you're using XMLUPDATEGRAM(), you might get into trouble with memos sometimes.

If you would like to run the following code, I would be interested in the results on your machine (whether the memo field content is included or not):
CREATE CURSOR test (f1 c(10), f2 m)
SELECT test
CURSORSETPROP("Buffering", 5)
CURSORSETPROP("KeyFieldList", "f1")
INSERT INTO test VALUES("1", "memo 1")
INSERT INTO test VALUES("2", "memo 2")
? XMLUPDATEGRAM()
Armin

Armin Neudert
Regional Director (Stuttgart) of German FoxPro User Group dFPUG

MCP for Visual FoxPro

Expert/Editor of the VFP section in the German Codezone community portal
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform