PRB: Update Conflict w/Remote View When WhereType Set to TimeLast reviewed: January 13, 1998Article ID: Q138809 |
3.00
WINDOWS
kbprg kbprb
The information in this article applies to:
SYMPTOMSCalling TABLEUPDATE() on a SQL table does not succeed in the following situation. A remote view on a SQL table contains a timestamp field, and the WhereType property of the view is set to "Key & Timestamp." When updates are sent to the remote SQL table, the first TABLEUPDATE() successfully updates records. However, if changes are made to the local tables, and you call TABLEUPDATE() a second time, the update is not successful, or the "Update Conflict" error is displayed. However, the TimeStamp field is not modified in the local cursor, and you expected the update to be successful.
CAUSEWhen the SQL Where clause or the WhereType properties are set to "Key and TimeStamp," the update fails if the timestamp of the record on the remote table has changed since you first retrieved it. The TimeStamp field of the remote table is updated by the server. The first update to the table on the server modifies the TimeStamp field. If the data is not refreshed on the local server, the data on the cursor and the data on the remote server are not the same, and a conflict occurs when TABLEUPDATE() is called a second time. The following example illustrates this. The TimeStamp values are fictitious in this example, they are only for demonstration.
DBKey Field1 TimeStamp 1 "string1" 1 2 "string2" 2 3 "string3" 3Assume you've created a remote view against this table, and set all the fields to be updatable. Additionally, the Wheretype is "Key & Timestamp." If you change record two to "changed" instead of "string2," the local FoxPro cursor now looks like this:
DBKey FIELD1 TimeStamp 1 "string1" 1 2 "changed" 2 3 "string3" 3When you call TABLEUPDATE(), Visual FoxPro sends the change to the server. The server, in turn, updates the timestamp value for that record:
DBKey FIELD1 TimeStamp 1 "string1" 1 2 "changed" 10 3 "string3" 3 RESOLUTIONUse GO RECNO() and call REFRESH() to refresh the data on the local cursor before the second update takes place. You can also call REQUERY() if you want to recreate the cursor from the remote data. For more information about the difference between the REQUERY() and the REFRESH() functions, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q130462 TITLE : Difference Between REQUERY and REFRESH in Visual FoxProWith Visual FoxPro for Windows 3.0b, you do not need the GO RECNO(). REQUERY or REFRESH should be sufficient.
STATUSThis behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior
|
Additional reference words: 3.00 VFoxWin odbc
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |