waiting for bugtracker account confirmation but did very simple prog to demo problem
<--------------------- Create dataset code
procedure TForm1.Create_A_Dataset;
begin
thedata := Tbufdataset.Create(self);
with thedata.FieldDefs do
begin
add('Field1',ftstring,10,true);
add('Field2',ftstring,10,true);
add('Field3',ftstring,10,true);
add('Field4',ftstring,10,true);
add('Field5',ftstring,10,true);
end;
thedata.CreateDataset;
end;
<------------------------------Populate dataset code
procedure TForm1.PopulateDatasetClick(Sender: TObject);
var I,J,thevalue : integer ;
thefieldname: string;
begin
thedata.close;
thedata.open;
for i := 1 to 100 do;
begin
thedata.Append;
for j := 1 to 5 do
begin
thefieldname := 'Field' + inttostr(j);
thevalue := i + j;
thedata.FieldByName(thefieldname).asstring := inttostr(thevalue);
end;
thedata.post;
end;
end;
this should put in 100 records but when you inspect the DB it only has 1 record the last one. So the append is failing by overwriting the first record and not appending it as it should
D