Microsoft KB Archive/169102
Article ID: 169102
Article Last Modified on 8/10/1999
- Microsoft Visual FoxPro 5.0 Standard Edition
- Microsoft Visual FoxPro 5.0a
This article was previously published under Q169102
In a multi-user application, if you have two forms with private DataSessions that include cursors that are based on the same table, the REQUERY() function returns old data on a form opened after the update of data on another session of the application.
The problem is in the buffering of data, and the fact that REQUERY() is not overriding the SET REFRESH timing. If the form is creating a second DataSession with a cursor pointing to the same table as the first DataSession, the new DataSession uses the data from the existing cursor.
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.
Steps to Reproduce Behavior
NOTE: This is a multi-user test. References to User1 and User2 indicate two separate instances of Visual FoxPro. This can be on separate machines, or two sessions of Visual FoxPro on the same machine.
In a project with at least one table ('Table1' in this example), create the following:
- Two local views based on Table1.
- Filter the views to return one record. Ensure it is the same record in both views.
- Create two forms: Form1 and Form2.
- Place one view in the DataEnvironment of Form1.
- Place the second view in the DataEnvironment of Form2.
- Place two or three text boxes on each form bound to fields in the respective views
- Set the DATASESSION property to Private on both forms.
- Set the BUFFERMODE of each form to anything but None.
On Form1, create a command button with the following code:
Create a second command button on Form1 with the following code:
DO FORM FORM2
Create a command button on Form2 with the following code:
- User1: Run Form1.
- User2: Run Form1.
- User1: Modify the data in Field1, and click the TableUpdate button.
- User2: Click the Form2 button on Form1, and click the Requery button.
Notice that it does not update with the updated information from User1. Waiting more than 5 seconds, assuming the REFRESH is set to the default '0,5', then clicking the Requery button populates the fields with the updated information.
Additional query words: Multi-User Requery Refresh
Keywords: kbbug KB169102