Ver Mensaje Individual
  #3  
Antiguo 19-04-2007
jourdan jourdan is offline
Miembro
 
Registrado: may 2003
Ubicación: Mexico
Posts: 151
Reputación: 22
jourdan Va por buen camino
No recuerdo muy bien como lo solucione, ya que fue hace mucho pero aqui te copio el codigo que esta funcionando sin probelma!

//cerramos la conexion a la abse de datos si es que estaba abierta
DM_ServidorDatos.IB_DB_Tintoreria.Connected := false;

// copia base de DAtos para tener respaldo
MCopia.Visible := true;
ProgressBar1.Visible := true;
MCopia.Lines.clear;
Try
CopyFile('D:\tintoreria_basedatos\TINTORERIA_LOCAL.FDB',
'D:\tintoreria_basedatos\RESPALDO_DE_SEGURIDAD\TINTORERIA_LOCAL.FBK');

ProgressBar1.StepIt;

MCopia.Lines.Add('**Copia de Seguridad Realizada con exito');

except
showmessage('Error');
end;

//***
with IBBackupService1 do
begin
Active := True;
try
Screen.Cursor := crHourGlass;
BackupFile.Clear;
// Cargamos la opciones que nos indique el usuario
Options := [];
Options := Options + [IgnoreCheckSums];
Options := Options + [IgnoreLimbo];
//if chkbkStructure.Checked then Options := Options + [MetadataOnly];
//if chkbkGarbage.Checked then Options := Options + [NoGarbageCollection];
Options := Options + [NonTransportable];
// Cargamos la información que nos han indicado
// Base de datos origen
DatabaseName := 'D:\tintoreria_basedatos\TINTORERIA_LOCAL.FDB';
// Fichero GBK destino
BackupFile.Add('D:\tintoreria_basedatos\RESPALDO_TINTORERIA.GDK');
// ¿Ver el progreso de la operación?
//Verbose := chkbkVerbose.Checked;
Verbose := true;
// Comenzar
ServiceStart;
if Verbose then
begin
// Mientras no se llegue al final...
While not Eof do
// Cargamos las lineas de salida en el memo
MCopia.Lines.Add(GetNextLine);
// Avisamos que hemos terminado
MCopia.Lines.Add('¡ ** PROCESO TERMINADO ** !');
ProgressBar1.StepIt;
end;
finally
Active := False;
Screen.Cursor := crDefault;
end;
end;
ProgressBar1.StepIt;

with IBRestoreService1 do
begin
Active := True;
try
Screen.Cursor := crHourGlass;
DatabaseName.Clear;
BackupFile.Clear;
// Cargamos las opciones que nos indiquen
Options := [];
Options := Options + [Replace];
Verbose := true;
PageBuffers := 3000;
PageSize := 4096;
// Indicamos la base de datos destino
DatabaseName.Add('D:\tintoreria_basedatos\TINTORERIA_LOCAL.FDB');
// El archivo GBK origen
BackupFile.Add('D:\tintoreria_basedatos\RESPALDO_TINTORERIA.GDK');
// Cerramos la conexión con la base de datos.

DM_ServidorDatos.IB_DB_Tintoreria.CloseDataSets;
DM_ServidorDatos.IB_DB_Tintoreria.Connected := false;
// Comenzar
ServiceStart;

if Verbose then
begin
While not Eof do
MCopia.Lines.Add(GetNextLine);
MCopia.Lines.Add('¡ PROCESO TERMINADO !');
ProgressBar1.StepIt;
end;
finally
Active := False;
// Vovemos a conectar con la base de datos
Screen.Cursor := crDefault;
end;
end;
__________________
Alejandro Jourdan
Responder Con Cita