ADO Database Delphi

Title: How to create a Dataset lookup field at runtime
with TStringField.Create(YourDataSet) do
begin
FieldName := 'FieldName';
FieldKind := fkLookup;
DataSet := YourDataSet;
Name := DataSet.Name + FieldName;
KeyFields := 'YourKeyFields';
LookupDataSet := YourLookupDataSet;
LookupKeyFields := 'YourLookupKeyFields';
LookupResultField := 'YourLookupResultField';
FieldDefs.Add(FieldName, ftString, 50, False);
end;