Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Code to backup FB databse is not working.Why?


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 20 - Last Post: Oct 16, 2017 2:39 AM Last Post By: Eduardo Tavares
Eduardo Tavares

Posts: 29
Registered: 1/17/05
Code to backup FB databse is not working.Why?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 9, 2017 3:48 AM
Hi!
I am trying to make an application that will back up my firebird database and I am using this code :


  TGera = class(TThread)
  protected
    procedure Execute; override;
  end;
 
  TRestaura = class(TThread)
  protected
    procedure Execute; override;
  end;
 
var
  frmBackUp: TfrmBackUp;
  GeraBackup     : TGera;
  RestauraBackup : TRestaura;
 
procedure TfrmBackUp.btBackUpClick(Sender: TObject);
begin
  SALVAR.InitialDir := ExtractFilePath(Application.ExeName) + 'BACKUP\';
  SALVAR.FileName   := UpperCase(FormatDateTime('DDDD',DATE) + ' - ' + DatetoStr(Date));
 
  SALVAR.Execute;
 
  if SALVAR.FileName <> '' then
  begin
    GeraBackup := TGera.Create(False); // Inicia a Thread para a geração do backup.
  end;
end;
 
procedure TfrmBackUp.FormCreate(Sender: TObject);
Var
  CONF : TIniFile;
begin
  CONF             := TIniFile.Create(ChangeFileExt(Application.ExeName,'.cfg'));
  SERVIDOR         := CONF.ReadString('DATABASE','SERVER','');
  BANCO            := CONF.ReadString('DATABASE','PATH','');
  CONF.Free;
end;
 
{ TGera }
 
procedure TGera.Execute;
begin
  inherited;
  FreeOnTerminate := True;
 
  try
    with frmBackup do
    begin
      Backup.ServerName      := SERVIDOR;
      Backup.DatabaseName    := BANCO;
      Backup.BackupFile.Text := SALVAR.FileName;
      BackUp.Attach;
      Backup.Active := True;
      Backup.ServiceStart;
      Memo.Lines.Clear;
      Memo.Lines.Add('Backup iniciado em ' + FormatDateTime('dd/mm/yyyy - hh:mm:ss', Now));
      Memo.Lines.Add(' ');
      While not Backup.Eof do
        Memo.Lines.Add(Backup.GetNextLine);
      Backup.Active := False;
      Memo.Lines.Add('Backup finalizado em ' + FormatDateTime('dd/mm/yyyy - hh:mm:ss', Now));
      Application.MessageBox(' SUA CÓPIA DE SEGURANÇA FOI GERADA.',' CÓPIA DE SEGURANÇA', MB_OK + MB_ICONINFORMATION);
    end;
  except
    Application.MessageBox(' ERRO AO GERAR O ARQUIVO DE BACKUP.' + #13 + ' REINICIE O APLICATIVO E TENTE NOVAMENTE.',' ATENÇÃO', MB_OK + MB_ICONERROR);
  end;
end;
 
{ TRestaura }
 
procedure TRestaura.Execute;
begin
  inherited;
  FreeOnTerminate := True;
  try
    with frmBackup do
    begin
      Restore.ServerName        := SERVIDOR;
      Restore.DatabaseName.Text := BANCO;
      Restore.BackupFile.Text   := ABRIR.FileName;
      Restore.Active := True;
      Restore.ServiceStart;
      Memo.Lines.Clear;
      Memo.Lines.Add('Restauração iniciada em ' + FormatDateTime('dd/mm/yyyy - hh:mm:ss', Now));
      Memo.Lines.Add(' ');
      While not Restore.Eof do
        Memo.Lines.Add(Restore.GetNextLine);
      Restore.Active := False;
      Memo.Lines.Add('Restauração finalizada em ' + FormatDateTime('dd/mm/yyyy - hh:mm:ss', Now));
      Application.MessageBox(' A CÓPIA DE SEGURANÇA FOI RESTAURADA.',' CÓPIA DE SEGURANÇA', MB_OK + MB_ICONINFORMATION);
    end;
  except
    Application.MessageBox(' ERRO AO RESTAURAR O ARQUIVO DE BACKUP.' + #13 + ' REINICIE O APLICATIVO E TENTE NOVAMENTE.',' ATENÇÃO', MB_OK + MB_ICONERROR);
  end;
  {Retiva os Timers}
end;

but everytime I click backUp Button the code inside the except runs and my backup file is not created of course.

what am I doing wrong?

thank you

Ronald Klitsche

Posts: 326
Registered: 8/26/01
Re: Code to backup FB databse is not working.Why?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 9, 2017 5:23 AM   in response to: Eduardo Tavares in response to: Eduardo Tavares
Eduardo Tavares wrote:
but everytime I click backUp Button the code inside the except runs and my backup file is not created of course.

what am I doing wrong?

Hi Eduardo,
you mix the TIBBackupService component across TThreads. The UI Thread and your TGera thread.
Please create/free the TIBBackupService inside the TGera.Execute as local var.
if you want to interact with the UI, like Memo oder MessageBoxes
use the Synchonize method: http://docwiki.embarcadero.com/Libraries/XE7/en/System.Classes.TThread.Synchronize
Eduardo Tavares

Posts: 29
Registered: 1/17/05
Re: Code to backup FB databse is not working.Why?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 9, 2017 5:34 AM   in response to: Ronald Klitsche in response to: Ronald Klitsche
Ronald Klitsche wrote:
Eduardo Tavares wrote:
but everytime I click backUp Button the code inside the except runs and my backup file is not created of course.

what am I doing wrong?

Hi Eduardo,
you mix the TIBBackupService component across TThreads. The UI Thread and your TGera thread.
Please create/free the TIBBackupService inside the TGera.Execute as local var.
if you want to interact with the UI, like Memo oder MessageBoxes
use the Synchonize method: http://docwiki.embarcadero.com/Libraries/XE7/en/System.Classes.TThread.Synchronize

hi!First of all thank you for your help...I am getting an error saying your user name and password are not defined.ask your databse administrator to set up an interbase login.
Ronald Klitsche

Posts: 326
Registered: 8/26/01
Re: Code to backup FB databse is not working.Why?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 9, 2017 5:51 AM   in response to: Eduardo Tavares in response to: Eduardo Tavares
Eduardo Tavares wrote:
I am getting an error saying your user name and password are not defined.ask your databse administrator to set up an interbase login.

then you have to set them, via Params of the TIBBackupService

Params.Values['USER_NAME'] := <UserName>
Params.Values['PASSWORD'] := <Password>;

and set LoginPrompt := False;
Eduardo Tavares

Posts: 29
Registered: 1/17/05
Re: Code to backup FB databse is not working.Why?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 9, 2017 6:17 AM   in response to: Ronald Klitsche in response to: Ronald Klitsche
Ronald Klitsche wrote:
Eduardo Tavares wrote:
I am getting an error saying your user name and password are not defined.ask your databse administrator to set up an interbase login.

then you have to set them, via Params of the TIBBackupService

Params.Values['USER_NAME'] := <UserName>
Params.Values['PASSWORD'] := <Password>;

and set LoginPrompt := False;

I did and it keep say the same thing...
Ronald Klitsche

Posts: 326
Registered: 8/26/01
Re: Code to backup FB databse is not working.Why?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 9, 2017 6:43 AM   in response to: Eduardo Tavares in response to: Eduardo Tavares
Eduardo Tavares wrote:
I did and it keep say the same thing...

Can you make a backup without Threading.
Maybe within a simple TButton Click?
Eduardo Tavares

Posts: 29
Registered: 1/17/05
Re: Code to backup FB databse is not working.Why?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 9, 2017 7:17 AM   in response to: Ronald Klitsche in response to: Ronald Klitsche
Ronald Klitsche wrote:
Eduardo Tavares wrote:
I did and it keep say the same thing...

Can you make a backup without Threading.
Maybe within a simple TButton Click?

No, i can´t.same error message
Ronald Klitsche

Posts: 326
Registered: 8/26/01
Re: Code to backup FB databse is not working.Why?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 9, 2017 7:21 AM   in response to: Eduardo Tavares in response to: Eduardo Tavares
Eduardo Tavares wrote:
Ronald Klitsche wrote:
Eduardo Tavares wrote:
I did and it keep say the same thing...

Can you make a backup without Threading.
Maybe within a simple TButton Click?

No, i can´t.same error message

The default user/password fail too?

Params.Values['USER_NAME'] := 'sysdba';
Params.Values['PASSWORD'] := 'masterkey';
Eduardo Tavares

Posts: 29
Registered: 1/17/05
Re: Code to backup FB databse is not working.Why?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 9, 2017 12:30 PM   in response to: Ronald Klitsche in response to: Ronald Klitsche
Ronald Klitsche wrote:
Eduardo Tavares wrote:
Ronald Klitsche wrote:
Eduardo Tavares wrote:
I did and it keep say the same thing...

Can you make a backup without Threading.
Maybe within a simple TButton Click?

No, i can´t.same error message

The default user/password fail too?

Params.Values['USER_NAME'] := 'sysdba';
Params.Values['PASSWORD'] := 'masterkey';

Yes Ronald

Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: Code to backup FB databse is not working.Why?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 9, 2017 9:11 AM   in response to: Eduardo Tavares in response to: Eduardo Tavares
Eduardo Tavares wrote:
Ronald Klitsche wrote:
Eduardo Tavares wrote:
I did and it keep say the same thing...

Can you make a backup without Threading.
Maybe within a simple TButton Click?

No, i can´t.same error message

Are you changing the protocol from local to TCP since you are setting a ServerName?

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)
Eduardo Tavares

Posts: 29
Registered: 1/17/05
Re: Code to backup FB databse is not working.Why?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 9, 2017 12:31 PM   in response to: Jeff Overcash (... in response to: Jeff Overcash (...
Jeff Overcash (TeamB) wrote:
Eduardo Tavares wrote:
Ronald Klitsche wrote:
Eduardo Tavares wrote:
I did and it keep say the same thing...

Can you make a backup without Threading.
Maybe within a simple TButton Click?

No, i can´t.same error message

Are you changing the protocol from local to TCP since you are setting a ServerName?

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

Jeff, thank you.I wasn´t but now that you mentioned I changed and I am getting this error message : cannot attach to service manager.
Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: Code to backup FB databse is not working.Why?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 9, 2017 2:06 PM   in response to: Eduardo Tavares in response to: Eduardo Tavares
Am 09.10.2017 um 21:31 schrieb Eduardo Tavares:
Jeff Overcash (TeamB) wrote:
Eduardo Tavares wrote:
Ronald Klitsche wrote:
Eduardo Tavares wrote:
I did and it keep say the same thing...

Can you make a backup without Threading.
Maybe within a simple TButton Click?

No, i can´t.same error message

Are you changing the protocol from local to TCP since you are setting a ServerName?

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

Jeff, thank you.I wasn´t but now that you mentioned I changed and I am getting this error message : cannot attach to service manager.

Hm, your question would be better suited for one of the database
newsgroups. Mabye the FireDAC one, as the developer of it is sometimes
reading it and answering.

I also used these components in the past and they worked.
I didn't use threads though and I don't remember details.

Since it's late enough in the evening already I also won't fire up my VM
to look at my old project and how I did it back then.

But it can be that local as protocol is not suited for this task.
Can you get some DB management software like IBExpert or one of the free
clones to do a backup? Maybe you can use such a software to figure out
the right parameters for the connection.

Greetings

Markus
Eduardo Tavares

Posts: 29
Registered: 1/17/05
Re: Code to backup FB databse is not working.Why?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 10, 2017 3:12 AM   in response to: Markus Humm in response to: Markus Humm
Markus Humm wrote:
Am 09.10.2017 um 21:31 schrieb Eduardo Tavares:
Jeff Overcash (TeamB) wrote:
Eduardo Tavares wrote:
Ronald Klitsche wrote:
Eduardo Tavares wrote:
I did and it keep say the same thing...

Can you make a backup without Threading.
Maybe within a simple TButton Click?

No, i can´t.same error message

Are you changing the protocol from local to TCP since you are setting a ServerName?

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

Jeff, thank you.I wasn´t but now that you mentioned I changed and I am getting this error message : cannot attach to service manager.

Hm, your question would be better suited for one of the database
newsgroups. Mabye the FireDAC one, as the developer of it is sometimes
reading it and answering.

I also used these components in the past and they worked.
I didn't use threads though and I don't remember details.

Since it's late enough in the evening already I also won't fire up my VM
to look at my old project and how I did it back then.

But it can be that local as protocol is not suited for this task.
Can you get some DB management software like IBExpert or one of the free
clones to do a backup? Maybe you can use such a software to figure out
the right parameters for the connection.

Greetings

Markus

Hi Markus! How would I do that with IBExpert?

thank you
Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: Code to backup FB databse is not working.Why?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 10, 2017 8:57 AM   in response to: Eduardo Tavares in response to: Eduardo Tavares
Am 10.10.2017 um 12:12 schrieb Eduardo Tavares:
Markus Humm wrote:

Hm, your question would be better suited for one of the database
newsgroups. Mabye the FireDAC one, as the developer of it is sometimes
reading it and answering.

I also used these components in the past and they worked.
I didn't use threads though and I don't remember details.

Since it's late enough in the evening already I also won't fire up my VM
to look at my old project and how I did it back then.

But it can be that local as protocol is not suited for this task.
Can you get some DB management software like IBExpert or one of the free
clones to do a backup? Maybe you can use such a software to figure out
the right parameters for the connection.

Greetings

Markus

Hi Markus! How would I do that with IBExpert?

thank you

There are menu items for backup and restore of the database in this
application.

Greetings

Markus
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: Code to backup FB databse is not working.Why?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 9, 2017 2:47 PM   in response to: Eduardo Tavares in response to: Eduardo Tavares
Eduardo Tavares wrote:
Jeff Overcash (TeamB) wrote:
Eduardo Tavares wrote:
Ronald Klitsche wrote:
Eduardo Tavares wrote:
I did and it keep say the same thing...

Can you make a backup without Threading.
Maybe within a simple TButton Click?
No, i can´t.same error message
Are you changing the protocol from local to TCP since you are setting a ServerName?

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

Jeff, thank you.I wasn´t but now that you mentioned I changed and I am getting this error message : cannot attach to service manager.

This is FireBird SuperServer right as there is no service manager for classic or
I believe the SS/Classic hybrid

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)
Eduardo Tavares

Posts: 29
Registered: 1/17/05
Re: Code to backup FB databse is not working.Why?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 10, 2017 3:10 AM   in response to: Jeff Overcash (... in response to: Jeff Overcash (...
Jeff Overcash (TeamB) wrote:
Eduardo Tavares wrote:
Jeff Overcash (TeamB) wrote:
Eduardo Tavares wrote:
Ronald Klitsche wrote:
Eduardo Tavares wrote:
I did and it keep say the same thing...

Can you make a backup without Threading.
Maybe within a simple TButton Click?
No, i can´t.same error message
Are you changing the protocol from local to TCP since you are setting a ServerName?

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

Jeff, thank you.I wasn´t but now that you mentioned I changed and I am getting this error message : cannot attach to service manager.

This is FireBird SuperServer right as there is no service manager for classic or
I believe the SS/Classic hybrid

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

yes
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: Code to backup FB databse is not working.Why?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 10, 2017 10:04 AM   in response to: Eduardo Tavares in response to: Eduardo Tavares
Eduardo Tavares wrote:
Jeff Overcash (TeamB) wrote:
Eduardo Tavares wrote:
Jeff Overcash (TeamB) wrote:
Eduardo Tavares wrote:
Ronald Klitsche wrote:
Eduardo Tavares wrote:
I did and it keep say the same thing...

Can you make a backup without Threading.
Maybe within a simple TButton Click?
No, i can´t.same error message
Are you changing the protocol from local to TCP since you are setting a ServerName?

yes

I would start by seeing if gbak is successful using the -se switch (-se
service_mgr).

Post the command line of the successful gbak.

Also in the samples directory in Database\IBX there is an admin sample. Try
running that and seeing if the backup there can work.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)
Eduardo Tavares

Posts: 8
Registered: 2/6/06
Re: Code to backup FB databse is not working.Why?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 10, 2017 12:04 PM   in response to: Jeff Overcash (... in response to: Jeff Overcash (...
Jeff Overcash (TeamB) wrote:
Eduardo Tavares wrote:
Jeff Overcash (TeamB) wrote:
Eduardo Tavares wrote:
Jeff Overcash (TeamB) wrote:
Eduardo Tavares wrote:
Ronald Klitsche wrote:
Eduardo Tavares wrote:
I did and it keep say the same thing...

Can you make a backup without Threading.
Maybe within a simple TButton Click?
No, i can´t.same error message
Are you changing the protocol from local to TCP since you are setting a ServerName?

yes

I would start by seeing if gbak is successful using the -se switch (-se
service_mgr).

Post the command line of the successful gbak.

Also in the samples directory in Database\IBX there is an admin sample. Try
running that and seeing if the backup there can work.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

I dont know how to use gbak -se but I did this gbak -SE path to database and I got error cannot attach to service manager...

but I could create a back via command line using GBAK -G -L -B -V -Z PATH + PATH TO FBD -USER SYSDBA -PASS masterkey

I ran the example from databsa ibx and I get the error cannot attach to service manager when I try to login

Edited by: Eduardo Tavares on Oct 10, 2017 12:06 PM
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: Code to backup FB databse is not working.Why? [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 10, 2017 2:52 PM   in response to: Eduardo Tavares in response to: Eduardo Tavares
Eduardo Tavares wrote:
Jeff Overcash (TeamB) wrote:
Eduardo Tavares wrote:
Jeff Overcash (TeamB) wrote:
Eduardo Tavares wrote:
Jeff Overcash (TeamB) wrote:
Eduardo Tavares wrote:
Ronald Klitsche wrote:
Eduardo Tavares wrote:
I did and it keep say the same thing...

Can you make a backup without Threading.
Maybe within a simple TButton Click?
No, i can´t.same error message
Are you changing the protocol from local to TCP since you are setting a ServerName?
yes
I would start by seeing if gbak is successful using the -se switch (-se
service_mgr).

Post the command line of the successful gbak.

Also in the samples directory in Database\IBX there is an admin sample. Try
running that and seeing if the backup there can work.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

I dont know how to use gbak -se but I did this gbak -SE path to database and I got error cannot attach to service manager...

but I could create a back via command line using GBAK -G -L -B -V -Z PATH + PATH TO FBD -USER SYSDBA -PASS masterkey

I ran the example from databsa ibx and I get the error cannot attach to service manager when I try to login

Edited by: Eduardo Tavares on Oct 10, 2017 12:06 PM

you add -se service_mgr


--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

Eduardo Tavares

Posts: 29
Registered: 1/17/05
Re: Code to backup FB databse is not working.Why? [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 11, 2017 3:18 AM   in response to: Jeff Overcash (... in response to: Jeff Overcash (...
Jeff Overcash (TeamB) wrote:
Eduardo Tavares wrote:
Jeff Overcash (TeamB) wrote:
Eduardo Tavares wrote:
Jeff Overcash (TeamB) wrote:
Eduardo Tavares wrote:
Jeff Overcash (TeamB) wrote:
Eduardo Tavares wrote:
Ronald Klitsche wrote:
Eduardo Tavares wrote:
I did and it keep say the same thing...

Can you make a backup without Threading.
Maybe within a simple TButton Click?
No, i can´t.same error message
Are you changing the protocol from local to TCP since you are setting a ServerName?
yes
I would start by seeing if gbak is successful using the -se switch (-se
service_mgr).

Post the command line of the successful gbak.

Also in the samples directory in Database\IBX there is an admin sample. Try
running that and seeing if the backup there can work.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

I dont know how to use gbak -se but I did this gbak -SE path to database and I got error cannot attach to service manager...

but I could create a back via command line using GBAK -G -L -B -V -Z PATH + PATH TO FBD -USER SYSDBA -PASS masterkey

I ran the example from databsa ibx and I get the error cannot attach to service manager when I try to login

Edited by: Eduardo Tavares on Oct 10, 2017 12:06 PM

you add -se service_mgr


--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)


I did this now gbak path\db.fdb path\db.fbk -se service_mgr and now I did not get any error and file db.fbkk was created
Eduardo Tavares

Posts: 29
Registered: 1/17/05
Re: Code to backup FB databse is not working.Why? [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 16, 2017 2:39 AM   in response to: Eduardo Tavares in response to: Eduardo Tavares
Eduardo Tavares wrote:
Jeff Overcash (TeamB) wrote:
Eduardo Tavares wrote:
Jeff Overcash (TeamB) wrote:
Eduardo Tavares wrote:
Jeff Overcash (TeamB) wrote:
Eduardo Tavares wrote:
Jeff Overcash (TeamB) wrote:
Eduardo Tavares wrote:
Ronald Klitsche wrote:
Eduardo Tavares wrote:
I did and it keep say the same thing...

Can you make a backup without Threading.
Maybe within a simple TButton Click?
No, i can´t.same error message
Are you changing the protocol from local to TCP since you are setting a ServerName?
yes
I would start by seeing if gbak is successful using the -se switch (-se
service_mgr).

Post the command line of the successful gbak.

Also in the samples directory in Database\IBX there is an admin sample. Try
running that and seeing if the backup there can work.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

I dont know how to use gbak -se but I did this gbak -SE path to database and I got error cannot attach to service manager...

but I could create a back via command line using GBAK -G -L -B -V -Z PATH + PATH TO FBD -USER SYSDBA -PASS masterkey

I ran the example from databsa ibx and I get the error cannot attach to service manager when I try to login

Edited by: Eduardo Tavares on Oct 10, 2017 12:06 PM

you add -se service_mgr


--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)


I did this now gbak path\db.fdb path\db.fbk -se service_mgr and now I did not get any error and file db.fbkk was created

What should I do now to make my code works?

thank you

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02