FieldByName('informationtype').AsString :=TEdit(findcomponent('Edit' + IntToStr(i))).Text;
数据总是添加不进去,是空值;而采用
s[i]:=TEdit(findcomponent('Edit' + IntToStr(i))).Text;    //s[i]为一字符串数组
FieldByName('informationtype').AsString :=s[i];却可以。
why?

解决方案 »

  1.   

    --
    create table table1( cname varchar2(100));
    --
    self.ADODataSet1.Close;
    self.ADODataSet1.CommandText:='select * from table1';
    self.ADODataSet1.Open;
    self.ADODataSet1.Append;
    self.ADODataSet1.FieldByName( 'cname' ).AsString:=TEdit( findComponent( 'edit1' ) ).Text;
    self.ADODataSet1.Post;--执行查询
    select * from table1
    --
    Edit1
      

  2.   

    若只执行
    FieldByName( "informationtype ").AsString   :=edit1.Text; 
    也没问题