Microsoft KB Archive/157405

= BUG: Reverting to OLDVAL Causes Error with Table Buffering =

Article ID: 157405

Article Last Modified on 10/16/2002

-

APPLIES TO


 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q157405



SYMPTOMS
With Table Buffering activated, trying to replace the current value with the value assigned to the OLDVAL function causes an error, and the table is not updated.



STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.



Steps to Reproduce Behavior
  Create and Populate a table as follows: CREATE TABLE sample ( Field1 C(5) UNIQUE ) INSERT INTO sample ( Field1 ) VALUES ( "one " ) INSERT INTO sample ( Field1 ) VALUES ( "two " ) INSERT INTO sample ( Field1 ) VALUES ( "three" )   Set optimistic(5) or pessimistic(4) table buffering on the table as follows: SET MULTILOCK ON     =CURSORSETPROP( "Buffering", 5 )   Change Field1 of the first record as follows: GO Top REPLACE field1 WITH "four"   Now move the record pointer to confirm the change as follows: SKIP SKIP -1   Insert OLDVAL into the record's field, which was just changed, and move the record pointer to submit the change as follows: REPLACE field1 WITH OLDVAL( "Field1" ) SKIP 

The "Uniqueness of index FIELD1 is violated" error message appears. You can click Cancel or Ignore to close the error message dialog box.

In order to Update the table again or to close it, you have to Revert the table (TableRevert(.T.)), which updates the table back to before the updates in steps 3 through 5 above.

NOTE: This problem does not exist if you are using Record Locking instead of File Locking.

Additional query words: kbvfp500 kbvfp500a kbvfp600

Keywords: kbbug kbprogramming KB157405

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.