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:
00703704
Views:
15
Hi Armin,

How's it going? See below for comments.


>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.


While it's obvious that the modified must be in the 'after' section, a MSDN article led me to believe that only the key fields in the 'before' section were required for updating existing records. I was just trying to find a way to easily achieve it. You know, just being lazy again :) It's not a problem, especially since it works nicely (so far). I just figured it'd be nice to keep the XML as compact and efficient as possible.



>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.


Ok, I'll try and play with memo fields today and let you know what I run into. I'm concerned about the binary fields though. I've been using the Northwind.employees (on SQL Server 2000) since it has both a memo (ntext) and image field. For reference, I'm passing SQL with the "FOR XML AUTO" clause via ADOCommand.Execute(), returning the result to an ADO Stream. If you want to see some code, let me know and I'll post it.


>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()
>
>

Results as follows:
<?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
<root xmlns:updg="urn:schemas-microsoft-com:xml-updategram">
	<updg:sync>
		<updg:before/>
		<updg:after>
			<test>
				<f1>1</f1>
			</test>
		</updg:after>
		<updg:before/>
		<updg:after>
			<test>
				<f1>2</f1>
			</test>
		</updg:after>
	</updg:sync>
</root>


VFP6 SP5, VFP8 SP1, VFP 9 SP 1 and Win XP SP 3 (unless otherwise specified)


www.wulfsden.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform