PRB: Update Conflict When Key Field Is Not Unique in Remote View (177062)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 3.0
  • Microsoft Visual FoxPro for Windows 3.0b
  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 5.0a
  • Microsoft Visual FoxPro for Windows 6.0

This article was previously published under Q177062

SYMPTOMS

The error "Update Conflict" appears when deleting, editing, or inserting records in a remote view if the key field chosen in the Update Criteria tab is not a unique field.

CAUSE

If FoxPro finds duplicate keys in the local buffer of the table, it generates this error. FoxPro uses the key field to uniquely identify the correct record to delete or edit. If FoxPro did not identify the record, it could delete or edit the wrong records.

RESOLUTION

Here are two workarounds for this problem:

  • Design the tables with a unique key field and mark the field as the key field in the Update Criteria tab of the view designer.

    -or-
  • If creating a unique key field is impossible, select multiple fields to be the keys in the Update Criteria tab. If these fields combine to make a unique key, update conflicts will not occur because FoxPro can uniquely identify the record.

STATUS

This behavior is by design.

REFERENCES

User's Guide Online, Chapter 5: Updating Data with Views

Technical Papers Online: Client Server Development

(c) Microsoft Corporation 1997, All Rights Reserved. Contributions by David Botzenhart, Microsoft Corporation

Modification Type:MajorLast Reviewed:5/12/2003
Keywords:kbprb KB177062