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, but cannot get a field to add. I tried this
var
  fld : TStringField;
begin
  if not ADOConnection1.Connected then
    ADOConnection1.Open;
  fld := TStringField.Create(tbl);
  fld.FieldName := 'test';
  tbl.Fields.Add(fld);
end;
But it doesn't work.