在用ado +access操作時,如何查找第二條?//
procedure TForm1.Button7Click(Sender: TObject);
var
   success:boolean;
begin
       adotable1.First;
       success:=adotable1.Locate(ComboBox1.Text,edit20.Text,[locaseinsensitive,lopartialkey]);
       if   not success then
            begin
            showmessage('§A¿é¤Jªº'+ComboBox1.Text+'¨S¦³§ä¨ì!!!');
            Button9.Enabled:=false;
            end;
procedure TForm1.Button9Click(Sender: TObject);
var
     success:boolean;
     str:string;
begin
       str:= ComboBox1.Text;
       success:=true;
       adotable1.Next;
     while (trim(adotable1.FieldValues[str]) <> trim(edit20.Text)) do
           begin
                 adotable1.Next;
                 if adotable1.Eof=true then
                 begin
                    success:=false;
                    break;
                 end;          end;       if  not success then
           begin
           showmessage('§A&iquest;é¤J&ordf;&ordm;'+ComboBox1.Text+'¨S&brvbar;&sup3;¤U¤@±&oslash;!!!');
           Button9.Enabled:=false;
           end;
       if success and (combobox1.Text<>'&cedil;ê&sup2;&pound;&frac12;s&cedil;&sup1;') then
          Button9.Enabled:=true;end;為甚麼一下到eof  了?   急!!!!

解决方案 »

  1.   

    是"如何查找第二條滿條足條件的記菉"
    adotable1.Next;
         while (trim(adotable1.FieldValues[str]) <> trim(edit20.Text)) do
               begin
                     adotable1.Next;
                     if adotable1.Eof=true then
                     begin
                        success:=false;
                        break;
                     end;