BUG: "Data Type Mismatch" Error After PACK When Used with an IDX File (286339)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 5.0a
  • Microsoft Visual FoxPro for Windows 6.0

This article was previously published under Q286339

SYMPTOMS

After you issue a PACK command and then insert records into a table that uses an IDX index file, the following error may occur:
Data type mismatch.

RESOLUTION

To work around this problem, use a structural index instead of an IDX index file.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Run the following code that demonstrates the problem:
    *!* Q286339 PRB: "Data Type Mismatch" Error After PACK When Used With a IDX
    *!* This code illustrates the problem described in the article.
    CREATE TABLE Test FREE (num N(10) , gen G)
    INSERT INTO Test (num) VALUES (1)
    INSERT INTO Test (num) VALUES (2)
    USE
    DELETE FILE Test.idx
    USE TEST
    INDEX ON  num TO Test FOR num <> 10
    
    USE Test INDEX Test
    INSERT INTO Test (num) VALUES (11)
    DELETE FOR num = 11
    PACK
    INSERT INTO Test (num) VALUES (12)
    BROWSE
    					
  2. The error shown in the "Symptoms" section appears. After the error occurs, the table appears empty when use the BROWSE command unless you recreate the index. To recreate the index, use the INDEX ON command.

REFERENCES

(c) Microsoft Corporation 2001, All Rights Reserved. Contributions by Mark Barnard, Microsoft Corporation.


Modification Type:MajorLast Reviewed:10/16/2002
Keywords:kbBug kbCodeSnippet kbDatabase kbDSupport KB286339