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