I am using code like the following when setting data to a record of a tvirtualtable:
VTTest.Clear; //remove old data
VTTest.Edit;
VTTestI_FIELD1.AsInteger := 100; // dummy kto#
VTTestC_FIELD2.Value := '100'; // dummy kto#
VTTest.Post;
somewhat later I do:
fname := ExtractFileDir(Application.ExeName) + '\Data2.xml';
if FileExists(fname) then VTTest.LoadFromFile(fname);
when I repeat now
VTTest.Clear;
VTTest.Edit;
VTTestI_FIELD1.AsInteger := 100; // dummy kto#
VTTestC_FIELD2.Value := '100'; // dummy kto#
VTTest.Post;
I get an exception in the line after setting editmode maybe because the fielddefs have changed. In fact they are the same (at least similar) as bevor .loadfromfile as the xml which I use in the IDE and while running the programm are nearly the same. They differ solely in data1.xml has no data in it but the data2.xml has. Fielddefs are the same in both xml-files.
My question is. Is it like I think it is
Thanks in advance
Michael