TxxxxFields get nil after assign

Discussion of open issues, suggestions and bugs regarding Virtual Data Access Components for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Posts: 14
Joined: Thu 11 Nov 2004 08:37

TxxxxFields get nil after assign

Post by juanmaria » Mon 13 Dec 2004 15:13


I'm using Sdac with Delphi 7 and keep finding a problem with VirtualTable fields after using assign.

For example, if I have a VirtualTable named vImp and a TFloatField named vImpAnte as follows:

vImp: TVirtualTable;
vImpANTE: TFloatField;

If I use this VT by itself it works fine, but if I want to populate it by doing an assign(AnotherSameStructureDataset) all the TxxxField under my VT become nil and I get an access violation when I try to access them.
However, I can still acces the newly populated fields using .fieldbyname or .fields[] but never with its associated TxxxFields

Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Mon 13 Dec 2004 16:41

VirtualTable component does not control fields compatibility within Assign method, therefore it clears all fields of TVirtualTable object. You must recreate required fields manually.

Post Reply