Subject | Re: Restoring database with Delphi components |
---|---|
Author | mickael.trecant |
Post date | 2012-10-28T18:41:20Z |
Hello ,
I use that component too , with Firebird and coding with Lazarus
( almost like Delphi ) .
I use this kind of code ( it works fine but can probably being
improved ) :
with restore do
begin
ServerName := '';
BackupFile.Clear;
BackupFile.Add('C:\Path\to\myBackupFile\someBackup.FBK');
DatabaseName.Clear;
DatabaseName.Add('C:\Path\to\myRestoredFile\myFDB.FDB');
with Params do
try
begin
Clear;
Add('user_name=sysdba');
Add('password=masterkey');
end;
try
Active := True;
ServiceStart;
while not EOF do
s := s + #13#10 + GetNextLine;
except
on e: Exception do
ShowMessage(E.ClassName + ' error raised, with
message : ' + E.Message);
end;
finally
Active := False;
end;
end;
end;
In the object inspector , I have some properties already set to true (
default value is false ) , there are :
for the options : 'replace' , 'createNewDB' .
protocol : local .
I also use the backup component ( TIBBackup ) and the validate
(TIBValidate) and they works fine with FB 2.1.4 ( good
performances ) , I hope this help .
Cheers ,
Mickaël .
--- In firebird-support@yahoogroups.com, "Fabiano" <fabianoaspro@...>
wrote:
I use that component too , with Firebird and coding with Lazarus
( almost like Delphi ) .
I use this kind of code ( it works fine but can probably being
improved ) :
with restore do
begin
ServerName := '';
BackupFile.Clear;
BackupFile.Add('C:\Path\to\myBackupFile\someBackup.FBK');
DatabaseName.Clear;
DatabaseName.Add('C:\Path\to\myRestoredFile\myFDB.FDB');
with Params do
try
begin
Clear;
Add('user_name=sysdba');
Add('password=masterkey');
end;
try
Active := True;
ServiceStart;
while not EOF do
s := s + #13#10 + GetNextLine;
except
on e: Exception do
ShowMessage(E.ClassName + ' error raised, with
message : ' + E.Message);
end;
finally
Active := False;
end;
end;
end;
In the object inspector , I have some properties already set to true (
default value is false ) , there are :
for the options : 'replace' , 'createNewDB' .
protocol : local .
I also use the backup component ( TIBBackup ) and the validate
(TIBValidate) and they works fine with FB 2.1.4 ( good
performances ) , I hope this help .
Cheers ,
Mickaël .
--- In firebird-support@yahoogroups.com, "Fabiano" <fabianoaspro@...>
wrote:
>that
> Hi all!
> I use a program write with Delphi XE2 to backup/restore my database.
>
> Currently I use the component: TIBRestoreService
>
> Sometimes I get an Access Violation in the restore process. I guess
> this component is used for Interbase database, not Firebird!and I can´t
> I looked out at dbExpress components TSQLConnection, etc
> figure out any component/way to backup and restore a Firebirddatabase.
>[Non-text portions of this message have been removed]
> Someone can tell me how to backup/restore a database, the right way.
>
> Thanks, Fabiano.
>
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>