Subject Re: [firebird-support] how do i run gbak from delphi
Author Helen Borrie
At 07:24 PM 17/07/2004 +0000, you wrote:
>Hi
>
>I am trying to run gbak from delphi using:
>shellexecute(form1.handle,'open',pchar
>(backupStr),nil,nil,sw_shownormal);
>
>where backupStr:= 'gbak [-b] -user sysdba -pass masterkey '+
>IB_connection1.databaseName +'backup18_07_04.gbk'
>
>but nothing appears to be happining.

There are some syntax errors in this gbak command. When run from the
directory where gbak is located, it should resolve to

gbak -b -user sysdba -pass masterkey drive:\path\filenameOfDatabase
drive:\path\filenameOfBackupfile

i.e., you can't use the local gbak syntax with a network method - you'd
need to invoke the Service Manager in order to use your
IB_Connection.DatabaseName (localhost:drive:\path\filenameOfDatabase). If
you are going to using properties from within an IBO application, use the
Path property.

>I have copied gbak.exe and
>fbclient.dll into the directory of the exe. The directory is on the
>same drive as firebird has been installed on.
>
>Can anyone suggest where it is going wrong?

Put gbak and fbclient.dll back where they belong and name the absolute path
to gbak.exe either in the shellexecute string or in an application resource
string.

Better still, don't try to use shellexecute, which is likely to give you
problems with spaces in the gbak path string, e.g. Program Files. Instead,
use the IBOBackupService component from the IBOAdmin suite of Lorenzo
Mengoni (www.mengoni.it)

/heLen