Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Problem with encryption and index of a Table
Mon, Jul 15 2013 10:52 AMPermanent Link

ThBrade

Hello,
I test DBISAM VCL-TRIAL - Version 1 4:36 Build with Delphi 2010.
A table is indexed and then encrypted.

Archiv1.zip contains the table before all actions.
Then the following commands are:

Archiv_Table.DeleteAllIndexes;
Archiv_Table.AddIndex ('IdxZaehl', 'counter', [ixPrimary]);
Archiv_Table.AddIndex ('GrabNr', 'Grabnummer, Name, Vorname', [ixCaseInsensitive]);
Archiv_Table.AddIndex ('IdxName', 'Name, Vorname, Grabnummer', [ixCaseInsensitive]);

Archiv2.zip contains the table after AddIndex

now

Archiv_Table.AlterTable(0,1,0, true,'11111','', 4096,512, -1,'', nil,'','', false);

Archiv3.zip contains the result.

The index is deleted and an ibk,bbk and dbk-file are created.

Why is the index deleted?
Can anyone help?

Regards
Thomas Brade

Attachment contains Archiv1.zip, Archiv2.zip and Archiv3.zip



Attachments: Archiv.zip
Mon, Jul 15 2013 11:27 AMPermanent Link

Raul

Team Elevate Team Elevate

Thomas,

Without seeing your source code it's a guess but are you adding the
indexes and encryption at the same time or as separate steps ?

If separate then did you reload the indexes in before (if not then
altertable thinks you want to delete all indexes).

e.g.: for altertable are you doing

Archiv_Table.FieldDefs.Update;
Archiv_Table.IndexDefs.Update;
Archiv_Table.AlterTable(0,1,0, true,'11111');


Raul




On 7/15/2013 10:52 AM, ThBrade wrote:
> Archiv3.zip contains the result.
>
> The index is deleted and an ibk,bbk and dbk-file are created.
>
> Why is the index deleted?
> Can anyone help?
Tue, Jul 16 2013 2:43 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

ThBrade


I was about to post much the same as Raul, but also suggest that you look at the SQL methods for maintaining table structure - they're much easier (in my opinion).

The files with the ??k extensions are the backup files created automatically when you alter the table structure. If you make a mistake and want to change back then its a simple matter of altering the extensions back to what they were - eg ibk -> idx

Roy Lambert [Team Elevate]
Wed, Jul 17 2013 3:32 AMPermanent Link

ThBrade

Hello,
thanks for the replies.

The commands
 Archiv_Table.FieldDefs.Update;
 Archiv_Table.IndexDefs.Update;

have helped to solve the problem.

Regards
Thomas
Image