close all
sele 2
      use B
sele 1
      use Ado while !eof()
   sele 2
         loca for b.HH==a.HH
         if found()
            sele 1
            repl a.HM with b.HM,a.NUM1 with b.NUM1,;
                 a.NUM2 with b.NUM2
         else
            sele 1
         endif
    skip
enddo
close allreturn
很简单啊。好久不用Foxpro,写起来还蛮有感情的。:)

解决方案 »

  1.   

    两个表建立关联sele b
    index on hh tag hh
    set order to hh
    sele a
    set relation to a.hh into a addi
    repl all a.hm with b.hm,... for a.hh=b.hh
      

  2.   

    TO:liuri(璇玑) 我看过你的文章,你的境遇和以前的我有些相似。不过我要告诉你,VFP用得再好,也上不了台面。不管微软吹得怎样?你还年轻,学一门新的语言,并精通它,方向可以是数据库等。
      

  3.   

    谢谢各位.我可是从来没有用过VFP,但是现在却要给用户导数据
      

  4.   

    Jhzyz(digitalife || 数字人生)
    谢谢谢谢^_^ 
    正在努力学习中……
      

  5.   

    update a set HM with b.HM;
                 NUM1 with b.NUM1;
                 NUM2 with b.NUM2
    where a.HH=b.HH好像是这样,具体格式我忘了,你试一试。