PRB: Records Seem Missing from FoxPro 2.5 Table in Later Vers

Last reviewed: March 23, 1995
Article ID: Q127873
The information in this article applies to:
  • Microsoft FoxPro for MS-DOS, versions 2.5a, 2.5b, 2.6, and 2.6a

SYMPTOMS

CDX tags containing a conditional test for the length of the key expression may return a different result set between FoxPro version 2.5 for MS-DOS and FoxPro version 2.5a (or higher) for MS-DOS, where trailing spaces (blanks) are stored with keys or are used to search for keys.

This problem occurs only when using an untouched version 2.5 table and CDX in a later version.

CAUSE

There was a minor change in how the CDX tag is stored and read from the CDX file between version 2.5 and later versions. This change was made to accommodate index key construction for other-than machine collation sequences.

RESOLUTION

Reindex the file in the current version.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Copy and run the following code in FoxPro version 2.5 for MS-DOS:

    CREATE TABLE cdxtest (f1 C(10)) INDEX ON f1 TAG f1 FOR f1 <> "ABCD" APPEND BLANK REPLACE f1 WITH "ABC"

    * Find a string with no trailing blanks ? "'ABC'" SEEK ("ABC")

       ? FOUND()                && Returns true in all versions
    
       * Find a string with trailing blanks
       ? "'ABC '"
       SEEK ("ABC ")
       ? FOUND()                && Returns true in 2.5
    
    

  2. Copy and run the following code in version 2.5a or later:

    USE C:\fpd25\cdxtest ORDER f1 && Open the file created in 2.5

    * Find a string with no trailing blanks ? "'ABC'" SEEK ("ABC")

       ? FOUND()                && Returns true in all versions
    
       * Find a string with trailing blanks
       ? "'ABC '"
       SEEK ("ABC ")
       ? FOUND()                && Returns *FALSE* until reindexed.
    
    

  3. Reindex the file in the later version. Then run the code again. Notice that the second SEEK where the string has trailing blanks is found this time.


Additional reference words: FoxDos 2.50a 2.50b 2.60 2.60a
KBCategory: kbusage kbprb
KBSubcategory: FxotherGeneral


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: March 23, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.