Ver Mensaje Individual
  #10  
Antiguo 03-12-2008
Avatar de Lepe
[Lepe] Lepe is offline
Miembro Premium
 
Registrado: may 2003
Posts: 7.424
Reputación: 29
Lepe Va por buen camino
Thumbs up

Código Delphi [-]
procedure TForm1.btnActualizaClick(Sender: TObject);
Var
  FechaActual : TDateTime;
begin

  with ADOQCambiar do
  begin
    SQL.Clear;

    SQL.Add ('UPDATE CuotasEmitidas SET FecSituacion = :pFecha'+
            'WHERE CuotasEmitidas.CodPers = 1801 ' +
            'AND CuotasEmitidas.NumRecibo = 810375');

    Prepare;
     if Parameters.ParamByName('pFecha') = nil then
     begin
        ShowMessage('uuuups, hace falta crear al parámetro en tiempo de ejecución con Parameters.Add( pFecha ) ');
     end
     else
     begin
        Parameters.ParamByName('pFecha').Direction := pdinput;
         Parameters.ParamByName('pFecha').DateType := ftDateTime;
        Parameters.ParamByName('pFecha').Value:= now;
     end;
    ExecSQL;
 end;
end;

Según veo estás borrando el SQL, eso hace que los parámetros también se eliminen (al menos es el comportamiento normal del Tquery, ignoro lo que hace TADOquery), En principio debería crearse al ejecutar el "Prepare" que he puesto, pero no sé las propiedades que tomaría, por eso las defino yo. Ejecuta y cuéntame si sale el showmessage, si no sale, el error que da, etc

Saludos
__________________
Si usted entendió mi comentario, contácteme y gustosamente,
se lo volveré a explicar hasta que no lo entienda, Gracias.
Responder Con Cita