while not(table2 eof) do
begin
table2.next;  
if not (table1 eof) 
  then       
    table1.next
  else
    添加记录;//简单而繁琐,就不写了  
end
应该没什么了吧。如果需要,我再把添加记录写给你

解决方案 »

  1.   

    table1.first;
    table2.first;
    while not table2.Eof do
      begin
     if not table1.locate('字段1',table2['字段1''],[]) then 
        begin
          table1.insert;
                 .
                 .
          table1.post;
          table2.next;
        end;
    end;
      

  2.   

    你的两个表有主键吗?
    如果有可以用FindKey,速度会更快一些!!
    先对其中一个表的所有数据进行循环,在循环中对表中的数据在另一个表中进行FindKey,然后具体怎么做你也就知道了!!
    不过,这样如果数据量特别大的话,会影响速度!!