for i:=0 to memo3.lines.count-1 do
   begin
     with adodateset1 do
        try
           if active then close;
           CommandText:='select bh from kq where nm='''+memo3.lines[i]+'''';
           open;
           memo4.lines.Add(memo3.lines[i]+'的编号是'+fieldbyname('bh').asstring);
        finally
           close;
        end;
    end;

解决方案 »

  1.   

    上面的MEMO有错误,改为下面的试下
    for i:=0 to memo3.lines.count-1 do
       begin
         with adodateset1 do
            try
               if active then close;
               CommandText:='select bh from kq where nm='''+memo3.Lines.Strings[i]+'''';
               open;
               memo4.lines.Add(memo3.lines.strings[i]+'的编号是'+fieldbyname('bh').asstring);
            finally
               close;
            end;
        end;