rsa.open ....
rsb.open ....
do while not rsb.eof
  if rsa.field(0)&""=rsb.field(5)&"" then
     rsa.field(1)=rsa.field(1)&"" + rsb.field(5)&""
  else
     rsa.addnew
     rsa.field(0)=rsb.field(5)&""
     rsa.field(1)=rsb.field(1)&""
  end if
  rsa.update
  rsb.movenext
loop其實妳用SQL語句實現更好.讓服務器執行.

解决方案 »

  1.   

    rsA.Open "SELECT * FROM a ", cn_A, adOpenDynamic, adLockBatchOptimistic
    我怎样确定表A中有没有记录的Field(0)等于表B当前记录的rsB.Flield(5)呢?
    那条语句怎么写?
      

  2.   

    试试SQL 语句:
     dim rs as new adodb.recordset
     dim cn as new adodb.connection
     cn.open"连接数据库" 
     rs.open"select rsa.field(0),rsb.field(5) from rsa,rsb where   rsa.field "(0)"rsa.field(5)"cn
     if not rs.eof then
        ................
     else
        ...............
     end if
    set rs = nothing
      

  3.   

    rs.open "select * from rsa where field_0_Name='" & rsb.field(5) & "'",cn
    if not rs.eof then
      exist
      do. ...
    else
      no exist
      do...
    end if
    rs.close