Microsoft KB Archive/191637

= PRB: SEEK Returns Different Results Depending on No. of Fields =

Article ID: 191637

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * 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 Q191637



SYMPTOMS
The SEEK command returns different results depending on the number of fields in a table. If there are 62 or less fields in a table, the SEEK command returns false when another user unmarks a record that has been marked for deletion. If there are 63 or more fields in the table, the SEEK command returns true. The expected result would be that SEEK would return false. Make sure that the SET REFRESH is set to zero and that SET DELETED is on.



CAUSE
This seems to occur because FoxPro reads the table from the hard drive and retrieves the data if there are more than 62 fields in the table. If there are 62 fields or less, then FoxPro reads the data from the cache.



STATUS
This behavior is by design.



MORE INFORMATION
The preceding scenario depends on having two sessions of FoxPro open and marking a record for deletion in a table in the first session, then opening the same table in a second session. After switching back to the first session and recalling the record, the SEEK command returns false if there are 62 or less fields in the table or it returns true if there are 63 or more fields in the table. The SET REFRESH must be set to zero and SET DELETED ON, for this to occur.

Steps to Reproduce Behavior
 Open two sessions of FoxPro. Issue the SET REFRESH TO 0,0 command in both of the sessions. Open a table, shared, that contains 62 or less fields in the first session of FoxPro. Mark the first record for deletion and move the cursor off the record. Switch to the second session of FoxPro and issue a SET DELETED ON. Open the same table, shared, and set the order to one of the fields that has an index. Switch back to the first session of FoxPro and unmark the deletion from the first record and move the cursor off the record.  Switch back to the second session and issue the following command, giving the SEEK command the value of the field that is indexed in the first record that you unmarked for deletion the first FoxPro session: WAIT WINDOW IIF(SEEK(" "), ".T.", ".F.") NOTE: The SEEK command returns false.  Follow steps 2-5 using a table with 63 or more fields. Note that the SEEK command now returns true.</li></ol>

Additional query words: kbVFp300b kbVFp500 kbVFp500a kbVFp600 kbXBase KbDBFDBC kbDatabase

Keywords: kbprb KB191637

-

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

© Microsoft Corporation. All rights reserved.