我需要将某表中的满足条件的记录的某字段进行付值,我用的是Table控件,请问我该怎么办呢?请高手帮忙!

解决方案 »

  1.   

    table1.edit;
    table1.fieldByName('字段').value:=YourValue;
    table1.apply;
      

  2.   

    你的意思是不是这样:
    table1.first;
    while not table1.eof do
    begin
    if table1.fieldbyname('fieldname1').asstring='yours String' then
     begin
       table1.edit;
       table1['fieldname2']:='12212112';
       table1.post;
     end;
    table1.next;
    end;
      

  3.   

    table1.edit;
    table1.FieldByName('field1').asstring := edit1.text;
    //最好用asstring之类的确定类型的函数,否则的话用value的话可能效率比较低,因为需要系统对数据类型转换
    table1.apply;