I'm trying to use the virtualtable as a sort of 'flat file database'.
The problem I have, is that I want to make sure that all changes to data are saved to file immediately, but if I try to SaveToFile on AfterPost, it causes problems. it seems that the OnPost event is called for every record when you first load the data from file so my SaveToFile procedure is called when I am trying to load the data initially, I can get around this with a Try .. Except condition, but it cant be the best way to do this, and also it makes debugging very difficult.
Code: Select all
//----------------------------------------------------------------------------//
procedure TDataModule1.TASKS_TAfterPost(DataSet: TDataSet);
begin
Try
TASKS_T.Filtered := False;
TASKS_T.SaveToFile('TASKS.VTD');
TASKS_T.Filtered := True;
Except;
End;
end;
//----------------------------------------------------------------------------//
Thanks