TVirtualTable.LoadFromFile() problem
Posted: Thu 17 Jan 2013 06:40
Hello!
Could you help me please with TVirtualTable?
TVirtualTable has pair of methods:
My form definition is:
I do the following:
I have tried to set RestoreFields to FALSE and it works without any errors.
However, is it normal behavior when field refs are lost?
Thanks.
Could you help me please with TVirtualTable?
TVirtualTable has pair of methods:
Code: Select all
TVirtualTable.LoadFormFile(FileName: string; RestoreFields: boolean = TRUE);
TVirtualTable.SaveToFile(FileName: string; StoreFields: boolean = TRUE);Code: Select all
TfrmMyForm = class(TForm)
dstEvents: TVirtualTable;
dstEventsSerial: TIntegerField;
...
end;Code: Select all
procedure TfrmMyForm.btnMyActionClick(Sender: TObject);
begin
dstEvents.SaveToFile(dstEvents.Name + '.vtd');
...
dstEvents.LoadFormFile(dstEvents.Name + '.vtd');
...
dstEvents.Insert;
// next row raises an error, because dstEventsSerial = nil
dstEventsSerial.Value := dstEvents.RecordCount;
dstEvents.Post;
end;However, is it normal behavior when field refs are lost?
Thanks.