为什么会这样?太奇怪了
select * from x where id = :aId
根本查不到

解决方案 »

  1.   

    怎么可能呢procedure TForm1.Button1Click(Sender: TObject);
    begin
      with adoquery1 do
      begin
        close;
        sql.Clear;
        sql.Add('select * from a where rr = :rr') ;
        adoquery1.Parameters.ParamByName('rr').Value := strtoint(Edit1.Text);
        open;
        if recordcount <> 0 then
        begin
          showmessage(fieldbyname('s').AsString);
        end;
      end;
    end;可以的
      

  2.   

    改成'select * from x where id = '+inttostr(aId)试试