Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread DB modifier and Index info error 3.30
Mon, Jan 18 2010 7:48 AMPermanent Link

durumdara
Hi!

In our older system we used alter table and other sql commands to modify the tables when something is
changed in the application.

The new plan is that we write a simple script to make needed objects, changes, etc.

For this I must get additional informations about tables.

First I tried to see the index informations.

I tried with this code:

OpenTable(FTable)
FTable.RestructureIndexDefs.Update
for i := 0 to FTable.RestructureIndexDefs.Count - 1 do begin
...

Interesting that this code ran in the first N time.
But now the .Update failed:  List index out of bounds(0).

I can get normal index informations with IndexDefs.Update, but this structure not hold some DBISAM specific
informations.

Why I got this error? And why this working until this time?

Thanks: dd
Mon, Jan 18 2010 11:19 AMPermanent Link

"Raul"

Just a wild guess but are you by any chance deleting any of the indexes
(from RestructureIndexDefs) - if so then your loop may run one too many
iterations.
As a quick test run the loop from RestructureIndexDefs.Count - 1 downto 0
instead.

Raul


"durumdara" <durumdara@gmail.com> wrote in message
news:73F1E7D9-4B77-46D8-BC94-9F26DB8922F0@news.elevatesoft.com...
> Hi!
>
> In our older system we used alter table and other sql commands to modify
> the tables when something is
> changed in the application.
>
> The new plan is that we write a simple script to make needed objects,
> changes, etc.
>
> For this I must get additional informations about tables.
>
> First I tried to see the index informations.
>
> I tried with this code:
>
> OpenTable(FTable)
> FTable.RestructureIndexDefs.Update
> for i := 0 to FTable.RestructureIndexDefs.Count - 1 do begin
> ..
>
> Interesting that this code ran in the first N time.
> But now the .Update failed:  List index out of bounds(0).
>
> I can get normal index informations with IndexDefs.Update, but this
> structure not hold some DBISAM specific
> informations.
>
> Why I got this error? And why this working until this time?
>
> Thanks: dd
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4783 (20100118) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4783 (20100118) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


Wed, Jan 20 2010 3:43 AMPermanent Link

durumdara
"Raul" wrote:


>Just a wild guess but are you by any chance deleting any of the indexes
>(from RestructureIndexDefs) - if so then your loop may run one too many
>iterations.
>As a quick test run the loop from RestructureIndexDefs.Count - 1 downto 0
>instead.

The problem occured on "RestructureIndexDefs.Update". Interesting.

Now I changed the code by dbsys:

...
 t.RestructureFieldDefs.Update;
 t.RestructureIndexDefs.Update;
 fd := t.RestructureFieldDefs;
 id := t.RestructureIndexDefs;
...
 loops for process and show elements.
...

And it is working.

Thanks for your help:
  dd
Image