ApplyDiffgram Method
Applies a DiffGram to local Visual FoxPro tables.
ApplyDiffgram is supported only for XMLTable objects in the XMLAdapterTables collection. ApplyDiffgram disregards XMLField objects when the XMLFieldAlias property is empty.
XMLTable.ApplyDiffgram( [ cAlias [, oCursorAdapter [, lPreserveChanges [, Reserved ]]]] )
Parameters
cAlias
Specifies the alias of the target cursor. The value of cAlias defaults to the XMLTableAlias property, including when cAlias is an empty string ("").oCursorAdapter
Specifies a pre-existing CursorAdapter object.ApplyDiffgram attaches the temporary table-buffered cursor containing changes to the specified CursorAdapter object. ApplyDiffgram also applies any updates, such as modified, inserted, or deleted records, to the base table set for the CursorAdapter object or to the cursor matching the Alias property of the XMLTable object.
If you do not provide a value for oCursorAdapter, ApplyDiffgram automatically handles updates to the base table.
Note You can update the remote data source using the ApplyDiffgram method provided that the CursorAdapter is configured for such a purpose.
lPreserveChanges
Specifies that when you provide a custom CursorAdapter object, and ApplyDiffgram fails, whether to keep the cursor, with changes, attached to the CursorAdapter object and any changes to the properties of the CursorAdapter object intact.The following table describes the values for lPreserveChanges.
lPreserveChanges Description True (.T.) Keep the cursor with changes attached to the cursor adapter and the changes to the properties of the cursor adapter intact. (Default) False (.F.) Detach the cursor with changes and revert any changes that were made to the properties of the cursor adapter. Reserved
Reserved for future use. The default value is 0.
Remarks
Visual FoxPro checks the XMLFieldKeyfield property when executing ApplyDiffgram.
Tip When you use automatic updating, you should set the appropriate XMLFieldKeyfield properties in the Fields collection to True (.T.) to improve update performance.
Visual FoxPro changes the properties for a custom CursorAdapter as follows:
- If the Tables property is empty, Visual FoxPro sets it to the table specified by the cAlias parameter.
- Visual FoxPro sets SendUpdates to True (.T.).
- If the DataSource property is empty, Visual FoxPro sets it to "Native".
- If the KeyFieldList property is empty, Visual FoxPro adds key fields only if specified. Otherwise, Visual FoxPro adds all fields.
- If KeyFieldList is modified, Visual FoxPro sets the WhereType property to Key Fields (DB_KEY or 1).
- If the UpdatableFieldList property is empty, Visual FoxPro adds all fields.
- If the UpdateNameList property is empty, Visual FoxPro adds all fields and uses the table specified by the cAlias parameter as the base table.
After applying the DiffGram, Visual FoxPro restores all the listed property values to their previous states.
See Also
Methods | XMLTable Object Properties, Methods, and Events | Tables Collection (XMLAdapter) | XMLField Class | Alias Property | CursorAdapter Class | Fields Collection (XMLTable) | CursorAdapter Object Properties, Methods, and Events
Applies To: XMLTable Class