Ver Mensaje Individual
  #1  
Antiguo 10-03-2005
ronimaxh ronimaxh is offline
Miembro
 
Registrado: jun 2003
Ubicación: Rep. Dominicana
Posts: 307
Reputación: 21
ronimaxh Va por buen camino
ayuda con parametros en consulta

Hola amigos del club, aqui les tengo una pregunta sobre parametros uso ado con access 2000. Aqui está mi código
Código Delphi [-]
 begin
begin
    with frmdata.consulta_cheque do
       begin
         if tipo=1 then  //busqueda por beneficiario
            begin
              close;
              sql.Text:='';
              sql.Text:='select * from Vw_consulta_cheques where beneficiario like
              '+''''+'%'+beneficiario.Text+'%'+''''+ 'and periodo ='+''''+rxperiodo.Text+'''';
              open;
              cantidad.Value:=recordcount;
            end;
     
     
         if tipo=2 then  //busqueda por fecha
            begin
              close;
              Parameters.ParamByName('fechai').Value:=fechai.Date;
              Parameters.ParamByName('fechaf').Value:=fechaf.Date;
              sql.text:='select * from Vw_consulta_cheques where fecha between
              :fechai and :fechaf';
              open;
              cantidad.Value:=recordcount;
            end;
     
         if tipo=3 then //busqueda por monto
            begin
              close;
              Parameters.ParamByName('montoi').Value:=montoi.Value;
              Parameters.ParamByName('montof').Value:=montof.Value;
              sql.text:='select * from Vw_consulta_cheques where monto between
              :montoi and :montof';
              open;
              cantidad.Value:=recordcount;
            end;
       end;
 end;


Nota: el problema es el siguiente cuando hago la consulta por un tipo (usando TRadiobuttun) me la trea bien, pero cuando cambio a otro tipo el error que me da es consulta_cheque: parameter 'fechai' no found.

Nota2: Estos parametros están definidos en tquery en la propiedad (TParameters) y no se por que da ese error si los tiene.

Nota3: Disculpen por no poner las etiquetas visuales, es que no se usarlas.
__________________
ronimaxh
Rep. Dominicana

Última edición por marcoszorrilla fecha: 10-03-2005 a las 18:48:52.
Responder Con Cita