In my Delphi 2009 application I need to check if a field exists and if it doesn\'t add it during application execution.
I have figured out the test for the field,
Greate function works well!! just the part
for i := 0 to FieldsList.Count - 1 do
begin
FieldDef := DataSet.FieldDefList.FieldByName(FieldName);
Field := FieldDef.CreateField(DataSet.Owner, nil, FieldName, False);
try
Field.name := FieldName + IntToStr(random(MaxInt)); // make the name unique
except
Field.Free;
raise ;
end;
end;
replace FieldName
by FieldsList[i]