How to add a field programatically to a TAdoTable in Delphi

后端 未结 6 729
无人及你
无人及你 2021-01-16 10:48

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,

6条回答
  •  礼貌的吻别
    2021-01-16 11:41

    try this

     fld:= TStringField.Create(tbl);
        fld.FieldName := 'test';
        fld.DisplayLabel := 'test';
        fld.name := 'test';
        fld.DataSet := tbl;
        fld.Size := 30;
        tbl.Fields.Add(fld);
    

    Bye.

提交回复
热议问题