关于数据库中工资表的年月如何成批修改? 本月工资打印后,要修改年月字段,再打印下个月的,
我做时运行总出错,系统说,Table1 的 Dataset 不处于edit 状态,其实 
 table1.open;
 table1.edit;
    while not adoTable1.Eof do
    adotable1.FieldByName('年月').asstring:=Edit1.text;
这段程序错在那里,请高手帮忙

解决方案 »

  1.   

    adotable1.FieldByName('年月').asdatetime:=strtodate('2009-01-14'); 
      

  2.   

    试下这样:
    with adoTable1 do
    begin
    close;
    open;
    edit;
    end;
    while not adoTable1.Eof do 
    adotable1.FieldByName('年月').asstring:=Edit1.text; 
      

  3.   

    对上面我发的代码有错,即ADOtable1 和table1是不同的, 我两个混在一起了,试来度去都乱了,但即使改了也不成,老师提出的方案我也试了,一运行就死机了.
      谢谢大家的帮助,关于年月问题,可以放在报表中处理了,但对于delphi 处理字段值同数修改的问题没有解决,我用的是d7.
      

  4.   

    table1.open; 
        while not adoTable1.Eof do 
    begin
    放在这里-->table1.edit; 
        adotable1.FieldByName('年月').asstring:=Edit1.text; 
    post;
    end