TvirtualTable260 savetofile question

Discussion of open issues, suggestions and bugs regarding Virtual Data Access Components for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
dpap
Posts: 1
Joined: Thu 10 Oct 2019 17:18

TvirtualTable260 savetofile question

Post by dpap » Thu 10 Oct 2019 17:37

I use virtualtable to manage some data and save them to a file. Saving/loading file works ok except in one case.
If i delete a field from the table and then save it, when i load it again sows the deleted field (in a DBgrid) without the values.
But i don't want the deleted field at all!
Here is a code snipet i use
// table.Fields[j].free;
table.Fields[j].DisposeOf;
.....
table.SaveToFile(filename);

What's wrong, please ?

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: TvirtualTable260 savetofile question

Post by MaximG » Mon 11 Nov 2019 15:36

We've tested this behavior using the following code snippet and received the correct results.

Code: Select all

    ...
    var Field: TField;
    ...
    Field := VirtualTable.Fields[j];
    if Field <> nil then
      VirtualTable.DeleteField(Field.FieldName);
    VirtualTable.SaveToFile(filename);
    ...
Please try replicating it in your environment.

Post Reply