Board index » delphi » Persistent Fields

Persistent Fields

I do not remember how to add Persistant Fields at run time ?

Merci.
Yves Guena.

 

Re:Persistent Fields


var
  f : TField;
  i : integer;
begin
 table1.FieldDefs.Update
  Table1.Close;
  for i := 0 to Table1.FieldDefs.Count - 1 do
   //create persistent field that do not exist
   if table1.FindField(table1.FieldDefs[i].Name) = nil then
      table1.FieldDefs.Items[i].CreateField(Table1);
end;

--
Bill

Re:Persistent Fields


Quote
>I do not remember how to add Persistant Fields at run time ?

var
  f : TField;
  i : integer;
begin
 table1.FieldDefs.Update
  Table1.Close;
  for i := 0 to Table1.FieldDefs.Count - 1 do
   //create persistent field that do not exist
   if table1.FindField(table1.FieldDefs[i].Name) = nil then
      table1.FieldDefs.Items[i].CreateField(Table1);
end
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads