BUG: SET KEY TO Command Ignores Characters in the Expression

Last reviewed: August 28, 1995
Article ID: Q121638
The information in this article applies to:
  • Microsoft FoxPro for Windows, versions 2.6, 2.6a
  • Microsoft FoxPro for MS-DOS, versions 2.6, 2.6a

SYMPTOMS

When a database is ordered on a numeric field, the SET KEY TO command ignores characters placed in the expression.

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

The SET KEY TO command is a dBASE-compatible command used to limit access to records that meet a specified criteria. The value placed in the command must be of the same data type as that of the current index tag. When a numeric database tag is set and the SET KEY TO command is issued on a character expression, the character part of expression is ignored. This behavior is best demonstrated using the CLIENTS database located in the SAMPLE\ORGANIZE\DBFS subdirectory of the FoxPro 2.6 directory.

Steps to Reproduce Behavior

  1. Open the CLIENTS database.

  2. Modify the CLIENTS.CDX index file by adding a tag based on the TYPE field, and set the order to this tag.

  3. In the Command window, issue the following commands:

          SET KEY TO 2
          BROWSE
    

    Note that only type 2 records appear.

  4. Close the Browse window and issue the following command to clear the SET KEY TO command:

          SET KEY TO
    

  5. In the Command window, issue the following commands:

          SET KEY TO 2e
          BROWSE
    

Note that the Browse window continues to show the same records. If the same command is issued in dBASE, it causes an error message.


Additional reference words: FoxDos FoxWin 2.60 2.60a buglist2.60
buglist2.60a
KBCategory: kbprg kbbuglist
KBSubcategory: FxprgBrowse


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