Microsoft KB Archive/130165

From BetaArchive Wiki

PRB: LUPDATE() Does Not Return Date of Last Update

ID: Q130165

The information in this article applies to:

  • Microsoft FoxPro for Windows, version 2.6a

SYMPTOMS

When using a shared table, the LUPDATE() function does not return the date when the table was last updated.

CAUSE

When a shared table is updated, the 'date of last update' will not be adjusted until the table is closed.

The date of last update is stored in the header of the .DBF file. The LUPDATE() function reads the date of last update from the header of the .DBF file. When a change is made to a table that is used in shared mode, the last update information in the header of the .DBF file is not updated to reflect this fact until the table is closed. The header information is not updated each time a change is made to the table because doing so would adversely impact performance.

RESOLUTION

Close the table before calling the LUPDATE() function. If this is not feasible, store the date of last update into a memory variable before updating the table.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

1. Share a table between two computers. This table should have a "date of

   last update" that is earlier than today's date.

   CREATE TABLE mytable (cbill C(1))
   INSERT INTO mytable (cbill) VALUES ("a")
   INSERT INTO mytable (cbill) VALUES ("b")

2. Run the following code as indicated:

   computer 1: use mytable shared
               ? lupdate()  && shows date last updated

   computer 2: use mytable shared
               =flock()
               replace cBill with "1"
               unlock
               ? lUpdate()  && shows old date

   computer 1: ? lUpdate()  && shows old date

   computer 2: flush
               ? lUpdate()  && shows old date

   computer 1: =flock()
               ? lUpdate()  && shows old date

Additional reference words: FoxWin 2.60a KBCategory: kbprg kbprb KBSubcategory: FxprgGeneral


Last Reviewed: June 27, 1995
© 1999 Microsoft Corporation. All rights reserved. Terms of Use.