Home General

PackTable

edited September 2001 in General
Hi,

I'm developing a little program that enables the packing of all tables in a
database.
On the form there are: 1 TffDatabase object DB_Pack, 1 listbox, 1 gauge and
2 buttons (Pack and Close).

On the FormShow I do the following tasks:
DB_Pack.exclusive := True;
DB_Pack.Connected := True;
DB_Pack.GetTableNames(ListBox1.Items);

The following code is linked to the Pack-button:
procedure ....
Var
Lus: Integer;
TaskID: LongInt;
TaskStatus: TffREbuildStatus;
Done: Boolean;
Tabel: TffTable;
Begin
For Lus := 0 To Listbox1.Items.Count - 1 Do
Begin
Gauge1.Progress := 0;
Check(Tabel.PackTable(TaskID));
Check(Tabel.Session.GetTaskStatus(TaskID, Done, TastStatus));
While Not(Done) Do
Begin
Gauge1.Progress := TaskStatus.rsPercentDone;
Check(Table.Session.GetTaskStatus(TaskID, Done,
TaskStatus));
End;
Gauge1.Progress := 100;
End;
End;


When debugging, I get an Access Violation at the following code:
Check(Tabel.PackTable(TaskID));

Can someone tell me what I'm doing wrong? Doesn't Tabel represent the table
according to the table in the listbox (via Lus)?



Gerd Moors

Comments

This discussion has been closed.