BUG: Reverting to OLDVAL() Causes Error with Table Buffering

Last reviewed: April 24, 1997
Article ID: Q157405
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, versions 5.0, 5.0a

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. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Behavior

  1. 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" )
    

  2. Set optimistic(5) or pessimistic(4) table buffering on the table as follows:

          SET MULTILOCK ON
          =CURSORSETPROP( "Buffering", 5 )
    

  3. Change Field1 of the first record as follows:

          GO Top
          REPLACE field1 WITH "four"
    

  4. Now move the record pointer to confirm the change as follows:

          SKIP
          SKIP -1
    

  5. 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.


Keywords : buglist5.00 FxprgTable kbprg vfoxwin vfpbug5.0a kbbuglist kbprg
Version : 5.0 5.0a
Platform : WINDOWS
Issue type : kbbug


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 24, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.