Ver Mensaje Individual
  #9  
Antiguo 03-07-2012
Avatar de José Luis Garcí
[José Luis Garcí] José Luis Garcí is offline
Miembro Premium
 
Registrado: may 2003
Ubicación: Las Palmas de G.C.
Posts: 1.372
Reputación: 23
José Luis Garcí Va camino a la fama
ecfisa, he probado el código pero no va, lo único que he cambiado son las constantes y que lo ejecuto en un boton, te pongo el código por si ves, que he cometido algún error.

Código Delphi [-]
procedure TForm1.SpeedButton4Click(Sender: TObject);
const
   PATH_BACKUP = 'C:\TEBICA PROGRAMA\SEG BD\';
   FILE_BACKUP = 'C:\TEBICA PROGRAMA\BD\TEBICA.FDB';
var
  lpOperation, lpFile, lpParameters, lpDirectory: PChar;
  Nombre: string;
begin
//   Componer nombre de archivo (yyyymmdd.fbk)
  Nombre:= StringOfChar('0',4-Length(IntToStr(YearOf(Now))))+IntToStr(YearOf(Now)) +
    StringOfChar('0',2-Length(IntToStr(MonthOf(Now))))+IntToStr(MonthOf(Now)) +
    StringOfChar('0',2-Length(IntToStr(DayOf(Now))))+IntToStr(DayOf(Now))+ '.FBK';
  if not FileExists(Edit4.Text + Edit5.Text) then
    with TPanel.Create(nil) do
    try
      Caption:= 'Realizando copia de seguridad, aguarde un momento por favor...';
      Font.Size:= 14;
      Font.Name:= 'Arial';
      Width:= 600;
      Height:= 70;
      Left:= (Self.ClientWidth - Width) div 2;
      Top:= (Self.ClientHeight - Height) div 2;
      BevelInner:= bvNone;
      BevelOuter:= bvNone;
      BevelWidth:= 1;
      BorderStyle:= bsSingle;
      Ctl3D:= False;
      Parent:= Self;

      lpOperation:= 'open';
      lpFile:= 'gbak.exe';
//      lpParameters:= PChar('-v -t -user SYSDBA -password "masterkey" '+Edit3.Text + Edit4.Text + Edit5.Text);
      lpParameters:= PChar('-v -t -user SYSDBA -password "masterkey" '+ FILE_BACKUP + PATH_BACKUP + Nombre);
      lpDirectory:= PChar(GetEnvironmentVariable('ProgramFiles')+'\Firebird\Firebird_2_5\bin');
      ShellExecute(Handle, lpOperation, lpFile, lpParameters, lpDirectory, SW_HIDE);
    finally
      Free;
    end;
end;

Mi firebirrd es 2_5 y esta activo (Run) como un servicio y el (Start) en automático,por si te sirve de ayuda.
__________________
Un saludo desde Canarias, "El abuelo Cebolleta"
Responder Con Cita