Ver Mensaje Individual
  #3  
Antiguo 14-07-2015
DANIEL1818 DANIEL1818 is offline
Miembro
NULL
 
Registrado: abr 2015
Posts: 42
Reputación: 0
DANIEL1818 Va por buen camino
Cita:
Empezado por ecfisa Ver Mensaje
Hola DANIEL1818.

Yo creo que te conviene hacer el borrado con un TADOQuery desde un método en el datamodule:
Código Delphi [-]
procedure DM.BorrarComentario(const UserName: string);
var
  qy: TADOQuery;
begin
  qy := TADOQuery.Create(nil);
  try
    qy.Connection := ADOConnection1;
    qy.Close;
    qy.SQL.Text := 'DELETE FROM COMENTARIOS WHERE NOMBRE_USUARIO = :USUARIO'; 
    qy.Parameters.ParamByName('USUARIO').Value := UserName;
    qy.ExecSQL;
  finally
    qy.Free;
  end;
end;
y luego llamarlo desde el formulario de este modo:
Código Delphi [-]
...
begin
  DM.BorrarComentario( Label7_miNombre.Caption );

Saludos





Funcionó a la perfección!! Muchisimas gracias por darme siempre tu mejor ayuda
Responder Con Cita