Board index » delphi » Adding index "Table Level Changed" error

Adding index "Table Level Changed" error

Attempting to add an index to a dBase III+ table like this:

     Table1.AddIndex('foo','id',[]);

I get a "table level changed" exception.  What in the world does this
mean?  Index can be built in VDB or the database desktop without a
problem.

 

Re:Adding index "Table Level Changed" error


On Thu, 25 Mar 1999 10:27:39 -0800, Bruce Skogen <basko...@earthlink.net>
wrote:

Quote
>Attempting to add an index to a dBase III+ table like this:

>     Table1.AddIndex('foo','id',[]);

>I get a "table level changed" exception.  What in the world does this
>mean?  Index can be built in VDB or the database desktop without a
>problem.

The TTable.AddIndex method can only be used to add dBASE IV-style index
tags to a table. This is as opposed to dBASE III PLUS-style, non-maintained
NDX index files. Index tags can only be added to dBASE IV (or higher level)
tables and a change to the .DBF file header is made to indicate the
presence of a production index file (the .MDX file). In your case, the
dBASE III PLUS table was automatically converted to a dBASE IV table in
order to create the index tag as you requested.

You cannot use AddIndex (or any other built-in Delphi method) to create NDX
files. To do that, you have to use the BDE API function DbiAddIndex.
Various fields in the IDXDesc structure needed by DbiAddIndex are used to
create either a maintained or non-maintained index.

//////////////////////////////////////////////////////////////////////////
Steve Koterski                    "My problem lies in reconciling my gross
Technical Publications            habits with my net income."
INPRISE Corporation                             -- Errol Flynn (1909-1959)
http://www.borland.com/delphi

Other Threads