Microsoft KB Archive/114278

{| = BUG: Table Loses Order When Used Again =
 * width="100%"|

ID: Q114278

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 table is used again, the first instance of the table loses its order.

RESOLUTION
This problem occurs when an .IDX file is used to store the index. This problem does not occur when a .CDX file is used to store the index. The problem can therefore be avoided by storing index expressions in a .CDX file rather than in an .IDX file.

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
This behavior differs from that of dBASE IV. In dBASE IV, the original table will retain its order when another copy of that table is used again.

Steps to Reproduce Problem
The following code sample demonstrates this situation:

* Create a table with

CREATE TABLE test (myfld C(2)) INSERT INTO test (myfld) VALUES ("BB") INSERT INTO test (myfld) VALUES ("AA") INDEX ON myfld TO test.idx

CLOSE ALL SET EXCLUSIVE OFF

USE test ALIAS one INDEX test IN 1 SELECT one ? "1: "+ORDER   && Display ORDER before USE..AGAIN USE test AGAIN ALIAS two INDEX test IN 2 SELECT one ? "2: "+ORDER   && Display ORDER after USE..AGAIN When the above code is executed in dBASE IV, the ORDER function will indicate that the first instance of "test" retains its order when that table is used again. However, when this code is executed in FoxPro, the ORDER function will indicate that the first instance of "test" does not retain its order when that table is used again. NOTE: To run this code in dBASE IV, you must remove the CREATE TABLE and INSERT INTO code. You must also create a table and indices at the dot prompt before executing the code.

Additional reference words: FoxDos FoxWin 2.60 2.60a buglist2.60 buglist2.60a differences KBCategory: kb3rdparty kbprg kbprb kbbuglist KBSubcategory: FxinteropDbase
 * }