Board index » delphi » Dbase Table Level Changed when adding single field index

Dbase Table Level Changed when adding single field index

Hi,

I'm trying to create some single field indexes on a Dbase III+ table.
But sometimes, I don't know why
not always, an error message is raised: Table Level Changed. I tried a
lot of solutions. First,
I was using the Delphi TTable.AddIndex. Then, as it was not working, I
tried DbiAddIndex.
With Database Desktop, nothing happens. The index is created without
errors.
I have some questions:
1 - Why Database Desktop can create the index flawlessly and I cannot?
Is it using the BDE?
2 - Which new features the BDE would need to create a single field
index? Why change the TableLevel?
3 - Why is this error not always raised? In same conditions, it
sometimes happens and sometimes not.

Please, would someone help?

 

Re:Dbase Table Level Changed when adding single field index


On Thu, 03 Jun 1999 23:25:52 -0300, Andr Augusto de Oliveira Arag?o

Quote
<cali...@zaz.com.br> wrote:
>I'm trying to create some single field indexes on a Dbase III+ table.
>But sometimes, I don't know why
>not always, an error message is raised: Table Level Changed. I tried a
>lot of solutions. First,
>I was using the Delphi TTable.AddIndex. Then, as it was not working, I
>tried DbiAddIndex.
>With Database Desktop, nothing happens. The index is created without
>errors.
>I have some questions:
>1 - Why Database Desktop can create the index flawlessly and I cannot?
>Is it using the BDE?
>2 - Which new features the BDE would need to create a single field
>index? Why change the TableLevel?
>3 - Why is this error not always raised? In same conditions, it
>sometimes happens and sometimes not.

Delphi does not support the creation of dBASE non-maintained indexes (the
dBASE III PLUS-style NDX files). That is, there is no built-in method for
creating these indexes, though you could write one yourself. Delphi only
supports the creation of dBASE IV-style index tags contained in multiple
index files. Index tags -- no matter what front-end application is used to
create them -- cannot be created for dBASE III PLUS tables. The table
_must_ be converted to dBASE IV (or above) or the index tag cannot be
created.

So adding indexes to dBASE III PLUS tables in Delphi should *always*
require raising the table level and generate this exception. You can
_never_ add an index using the TTable.AddIndex method (which only works
with index tags) to dBASE III PLUS tables.

You can create non-maintained index files (.NDX files) to dBASE III PLUS
tables (and not generate a table level change) using the BDE API function
DbiAddIndex. A call to this function could then be incorporated into a
method of a custom class based on TTable, a class that specifically caters
to dBASE III PLUS tables...

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Steve Koterski     "An inventor is a person who makes an ingenious
Felton, CA         arrangement of wheels, levers and springs, and believes
                   it civilization."          -- Ernest Dimnet (1866-1954)

Re:Dbase Table Level Changed when adding single field index


Hi,

I'm trying to create some single field indexes on a Dbase III+ table.
But sometimes, I don't know why
not always, an error message is raised: Table Level Changed. I tried a
lot of solutions. First,
I was using the Delphi TTable.AddIndex. Then, as it was not working, I
tried DbiAddIndex.
With Database Desktop, nothing happens. The index is created without
errors.
I have some questions:
1 - Why Database Desktop can create the index flawlessly and I cannot?
Is it using the BDE?
2 - Which new features the BDE would need to create a single field
index? Why change the TableLevel?
3 - Why is this error not always raised? In same conditions, it
sometimes happens and sometimes not.

But, first, the Dbase III+ originally, uses NDX structure for the
indexes. NTX is the CLIPPER way.
MDX can only be used by Dbase IV. When we open a DBASE III table, and we
try to create a index,
Delphi raises the Table Level Changed option, unless we use the option
IxNonMaintained(DELPHI 4 and +).
If using the BDE Api, the DBIAddIndex, we must set the
IdxDesc.bMaintained to false. Then the index will be
created as ndx.
The horrible thing is: My system sometimes works, sometimes not. Now, it
is working when I Use Win NT, and isn't when
I use Win 98. If you have some new advice, send me, ok?
Thank YOU!

Please, would someone help?

Other Threads