Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: Update Resync Property Not Persisted Properly with XML Format


View products that this article applies to.

This article was previously published under Q245358

↑ Back to the top


Symptoms

The Update Resync dynamic property cannot be persisted properly when the Recordset object is saved in Extensible Markup Language (XML) format in releases of Microsoft Data Access Components (MDAC) prior to 2.5. It only works when the recordset is persisted in Advanced Data TableGram (ADTG) format.

↑ Back to the top


Cause

The only property that persists properly (in versions of MDAC prior to 2.5) is the UpdateCriteria rowset property. Update Resync is never persisted.

↑ Back to the top


Resolution

The following sample code fails in versions of MDAC earlier than 2.5. Run the code in a new Microsoft Visual Basic project to verify the behavior:

Note You must change User ID=<User ID> and password=<Strong Password> to the correct values before you run this code. Make sure that User ID has the appropriate permissions to perform this operation on the database.
Private Sub Command1_Click()
    
    Dim rs As New Recordset
    Dim cn As New Connection
    
    Dim var As Variant
    Dim var2 As Variant
    Dim rs2 As New Recordset

    cn.CursorLocation = adUseClient
    cn.Open "Provider=SQLOLEDB.1;server=RoseValley;database=test;uid=<User ID>;password=<Strong Password>
    rs.Open "select * from testident", cn, adOpenKeyset, adLockBatchOptimistic, -1

    rs.Properties("Update Resync") = adResyncUpdates
    Debug.Print rs.Properties("Update Resync")

    If Dir("C:\test.xml") <> "" Then Kill "C:\test.xml"

    rs.Save "C:\test.xml", adPersistXML

    rs2.Open "C:\test.xml", , , , -1
    Debug.Print rs2.Properties("Update Resync")

End Sub
				

↑ Back to the top


Status

This problem was corrected in MDAC version 02.50.00.3917.

↑ Back to the top


More information

The Update Resync property specifies whether the UpdateBatch method is followed by an implicit Resync method operation, and if so, the scope of that operation. This property sets or returns one of the following CEResyncEnum values:

  • adResyncNone
  • adResyncAutoIncrement
  • adResyncConflicts
  • adResyncUpdates
  • adResyncInserts
  • adResyncAll

↑ Back to the top


References

For more information, please refer to the Platform SDK for Windows 2000.

↑ Back to the top


Keywords: KB245358, kbmsxmlnosweep, kbmdac250fix, kbfix, kbbug

↑ Back to the top

Article Info
Article ID : 245358
Revision : 4
Created on : 11/5/2003
Published on : 11/5/2003
Exists online : False
Views : 443