Ver Mensaje Individual
  #1  
Antiguo 22-05-2016
Alex1255 Alex1255 is offline
Miembro
NULL
 
Registrado: ene 2012
Posts: 11
Reputación: 0
Alex1255 Va por buen camino
Mensajes memo de progreso de Backup

Hola a todos buenas tardes o Dias o Noches..tengo este procedimiento para respaldar la base de Datos el cual trabaja bien y me genera un respaldo...pero..(siempre hay un pero)...deseo que conforme va a avanzando me mande mensajes del avance del respaldo lo cual no lo hace solo me manda el mensaje final de : RESPALDO CONCLUIDO...Alguien me podria dar una sugerencia que me falta...muchas gracias.....

Código Delphi [-]
procedure TFrmDatosEmpresa.BtCrearrespaldoClick(Sender: TObject);
var Fecha:String;
begin
if (EdtRutaBD.Text='')then raise Exception.Create(
'Falta la ruta de la base de datos para crear el respaldo');

if (EdtNombreServidor.Text='')then raise Exception.Create(
'Falta el nombre del servidor o si es local la base de datos para crear el respaldo');

if not DirectoryExists(EdtRutaRespaldo.Text) then raise Exception.Create(
'La ruta especificada para crear el respaldo no existe');

if not FileExists(EdtRutaBD.Text) then raise Exception.Create(
'La ruta de la base de datos al parecer no esta en esta computadora. Respaldar donde esten los datos');

fecha:=FormatDateTime('DDMMMYYYY',Now);

if FileExists(EdtRutaRespaldo.Text+'\'+Fecha+'.fbk') then
  begin
  if Application.MessageBox('Ya existe un respaldo del dia de hoy. ¿Deseas reemplazarlo?',
  'Uinhapiti',MB_OKCANCEL)=IDCANCEL then
  SysUtils.Abort;

  if not DeleteFile(EdtRutaRespaldo.Text+'\'+Fecha+'.fbk') then
    begin
    Application.MessageBox('No se pudo quitar el archivo. Favor de eliminarlo','Uinhapiti',MB_OK);
    sysutils.abort;
    end;

  end;//if fileexists
 ShowMessage('Tenga paciencia tardara un poco ');
  Screen.Cursor:=crHourGlass;

{ahora sigue crear el respaldo de la base de datos}

modulodatos.IBDatabase1.Connected := false;
modulodatos.IBTransaction1.Active:=False;
 with modulodatos.IBBackupService do
  begin
  if EdtNombreServidor.Text = 'localhost' then
    begin
    ServerName := '';
    Protocol := Local;
    end
  else
  begin
  Protocol := TCP;
  ServerName := EdtNombreServidor.Text;
  end;
    Active := True;
    try
      {La ruta debe ser local y por lo tanto el respaldo debe hacerse en la pc
      donde esten los datos}
      DatabaseName := EdtRutaBD.Text;//ejemplo  'c:\interbase\examples\database\employee.gdb';
      BackupFile.Clear;
      BackupFile.Add(EdtRutaRespaldo.Text+'\'+Fecha+'.fbk');//' 'c:\temp\employee1.gbk');
       ServiceStart;
      While not Eof do
        MemoProgresodeRespaldo.Lines.Add(GetNextLine);
    finally
      MemoProgresodeRespaldo.Lines.Add('**RESPALDO CONCLUIDO**');
       Screen.Cursor:=crDefault;
      Active := False;
    end;
with modulodatos do
  begin
 IBDatabase1.Connected:=True;
 IBTransaction1.Active:=True;
 Qryjalarcontratos.Active:=True;
 QryContarti.Active:=True;
 QryAlma.Active:=True;
 Qryclien.Active:=True;
 QryCobr.Active:=True;
 Qryabon.Active:=True;
 Qrycontelim.Active:=True;
 Qryregiacce.Active:=True;
 QryBsqClien.Active:=True;
 QryUsua.Active:=True;
 QryListUsua.Active:=True;
 QryBsqAlma.Active:=True;
 qryuncliente.Active:=True;
 qrycontraanida.Active:=True;
 qryArticulanidados.Active:=True;
 IBdatosempresa.Active:=True;
 Qrylistclientes.Active:=True;
 QryClienCOD.Active:=True;
 QryBsqContra.Active:=True;
 QryArticuloseliminados.Active:=True;
 QryBsqAlmacen.Active:=True;
 Qrylisusua2.Active:=True;
 Qryclien2.Active:=True;
 Qrylistalma.Active:=True;
 QryVendList.Active:=True;
 QryCobraAlta.Active:=True;
 IBModif1Contrato.Active:=True;
 QryConsultContr.Active:=True;
 QryRepxCob.Active:=True;
 QryTotRepcobra.Active:=True;
 QryRepxCob.Active:=True;
 QryBsqTotCobr.Active:=True;
 QryRegisCambContra.Active:=True;
 Qryaltademovimiento.Active:=True;
 QryArticmpresion.Active:=True;
 QryAbonos2.Active:=True;
 QryAbonanida.Active:=True;
 QryEntSalRep.Active:=True;
  end;
  end;


Application.MessageBox('El respaldo se ha concluido con éxito.','Falcon20',MB_OK+MB_ICONINFORMATION);
end;
Responder Con Cita