Microsoft KB Archive/114145

{|
 * width="100%"|

-

The information in this article applies to:


 * Microsoft FoxPro for Windows, version 2.6
 * Microsoft FoxPro for MS-DOS, version 2.6

-

SYMPTOMS
When you attempt to use a dBASE IV (version 2.0) database, the following message is displayed:

Index does not match table. Re-create index.

CAUSE
The index blocksize in dBASE was set to a size other than 1 or 2 (or 512 bytes) with the SET IBLOCK command. The index blocksize can also be set with the SET BLOCKSIZE command, which sets the blocksize for both memo files and index files.

RESOLUTION
IMPORTANT: Neither of the two methods (described below) to correct this problem will work if the database has one or more memo fields that were converted to FoxPro memo fields before the "Index does not match table" error message was displayed.

Method 1
To make the dBASE .MDX file readable by FoxPro, issue the following commands from the dot prompt in dBASE IV:    USE SET IBLOCK TO 1 COPY TO WITH PRODUCTION This will make a new copy of the database and the index file with the correct index blocksize of 1 (512 bytes).

Method 2
If dBASE IV is not available, re-create the indexes as follows:

 Delete the .MDX file.  Issue the following command:       USE  Choose Ignore when you are warned "Structural CDX file not found." Re-create the index tag(s) in FoxPro either by choosing Setup from the Database menu or by using the INDEX ON command (see page L3-571 in the "Language Reference").

STATUS
Microsoft has confirmed this to be a problem in Microsoft FoxPro for Windows and MS-DOS, version 2.6. This problem was corrected in Microsoft FoxPro for Windows and MS-DOS, version 2.6a.

MORE INFORMATION
The SET IBLOCK command sets the blocksize for new index files in blocks of 512 bytes. Valid values range from 1 to 63. Any value greater than 2 will cause the problem described above.

Steps to Reproduce Problem
  In dBASE IV (version 2.0), issue the following commands:       SET IBLOCK TO 3 && or SET BLOCKSIZE TO 3 CREATE test * Add a field called 'ONE' that is Numeric, Width 5, * Decimals 0, Index 'Y'. USE   In FoxPro (version 2.6), try to open the database with this command:  <pre class="CODESAMP">     USE test You will receive the error message:

Index does not match table. Recreate index.

</li>  In dBASE IV, issue the following commands:  <pre class="CODESAMP">     SET IBLOCK TO 23 && or SET BLOCKSIZE TO 23 CREATE test2 * Add a field called 'ONE' that is Numeric, Width 5, * Decimals 0, Index 'Y'. * Add a second field called 'TWO' that is type 'Memo'. </li>  In FoxPro, try to open the database with this command:  <pre class="CODESAMP">     USE test2 You will be asked the following: Convert MEMO file to FoxPro Format?

This can later be reversed with

COPY ... TYPE FOXPLUS Choose Yes. (If you choose No, the error message "Not a table/.dbf" will be displayed and the table will not be opened.)

You will next be prompted with: Remove dBASE 'soft' carriage returns from memos?

Choose Yes if all memos are normal text

Choose No if any memos have binary data Choose Yes or No; it does not make a difference in the results.

You will receive this error message:

Index does not match table. Recreate index.

</li></ol>

At this point, you must use Method 2 (described above) to re-create the indexes because the memo file can no longer be read by dBASE IV. (The COPY TO ... TYPE FOXPLUS command can only be issued once the database is opened.) Additional query words: FoxDos FoxWin buglist2.60 mdx cdx re- create fixlist2.60a

Keywords         : FxinteropDbase Version          : 2.60 | 2.60 Platform         : MS-DOS WINDOWS Issue type       :
 * }