Hola maxi915.
Intenta de este modo:
Código Delphi
[-]
procedure buscarPagos(queryCliente: TADOQuery; const desde, hasta: string; grilla: TStringGrid);
var
i: Integer;
begin
with queryCliente do
begin
SQL.Clear;
SQL.Add('SELECT * FROM CLIENTES');
SQL.Add('WHERE FECHAPAGO BETWEEN :DESDE AND :HASTA');
Parameters.ParamByName('DESDE').Value:= desde;
Parameters.ParamByName('HASTA').Value:= hasta;
Open;
grilla.RowCount:=RecordCount+1;
i:=1;
while not Eof do
begin
grilla.Cells[0,i]:=fieldByName('NOMBRE').AsString;
grilla.Cells[1,i]:=fieldByName('APELLIDO').AsString;
grilla.Cells[2,i]:=fieldByName('TELEFONO').AsString;
Inc(i);
Next;
end;
Close;
end;
end;
(* ) El método
ExecSQL sólo se usa en consultas que no devuelven un cursor de datos (por ej.: INSERT, DELETE, etc.)
Saludos