for i:=0
to dm.ADODataSet1.FieldCount-1
do
begin
case Dm.ADODataSet1.Fields.Fields[i].DataType
of
ftString,ftWideString,ftDate,ftDateTime,ftCurrency,ftInteger, ftSmallint, ftFloat,ftWord :
begin
//label erzeugen
Labels:= TLabel.Create(new_ds);
Labels.Parent := new_ds;
Labels.Left :=10;
Labels.Width:=85;
Labels.Alignment:=taRightJustify;
Labels.Top := int_gesamt_top + 3;
Labels.Caption:=dm.ADODataSet1.FieldList.Strings[i];
//dbfeld erzeugen
DBEdit:= TDBEdit.Create(new_ds);
DBEdit.Parent := new_ds;
DBEdit.Left :=100;
DBEdit.Top := int_gesamt_top;
//und hier die abfrage, des aktuellen db-feldes
if dm.ADODataSet1.Fields.Fields[i].Required=True
then
begin ShowMessage('
not null'); DBEdit.Color:=clRed;
end;
DBEdit.DataSource:=dm.DataSource1;
DBEdit.
Name:=dm.ADODataset1.FieldList.Strings[i];
DBEdit.DataField:=dm.ADODataset1.FieldList.Strings[i];
int_gesamt_top:=int_gesamt_top + 30;
end;
//usw...