--table2.Open;
table2.Edit;
--table2.AppendRecord([hno,hname,hsex,hold,hphone,inttostr(j),inttostr(i),strtodate(hdate)]);

解决方案 »

  1.   

    if (table1.Eof)  then
      begin
         showmessage('测试结束');
         dbgrid1.Visible:=true;
         table1.Close;
         table2.Open;
         table2.edit;//add
         table2.AppendRecord([hno,hname,hsex,hold,hphone,inttostr(j),inttostr(i),strtodate(hdate)]);
         table2.Post;
         table2.Close;
         EXIT;
        end;
      

  2.   

    table的CachedUpdate属性要改为:true;
    if (table1.Eof)  then
      begin
         showmessage('测试结束');
         dbgrid1.Visible:=true;
         table2.Close;(注:table1要改为table2)
         table2.Open;
         table2.edit;
    table2.AppendRecord([hno,hname,hsex,hold,hphone,inttostr(j),inttostr(i),strtodate(hdate)]);
         table2.Post;
         table2.Close;
         EXIT;
        end;
      

  3.   

    with table2 do
    begin
      edit;
      AppendRecord(...
      ...
    end
      

  4.   

    AppendRecord(...)已自动post了.  Table2.state 不在 dsEdit 或 dsInsert之故.
      

  5.   

    table2.AppendRecord之前表一定要
    处于编辑状态
    所以先TABLE2.EDIT
      

  6.   

    不用Post了,不过要先Edit一下!
    ===================================================================
     暗恋女司机,薪水全做公交车了! 
    http://www.csdn.net/expert/topic/926/926315.xml?temp=4.807681E-02