Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Trying to do Backup/Restore - What am I missing??
Fri, Jul 29 2022 11:25 PMPermanent Link

Ian Branch

Avatar

Hi Team,
Win 1, D11.1, latest DBISAM.
The App & database are in the e:\dlogger directory.
I want to just backup and later restore just the TravelLog data.
I want the backup file to go into the e:\dlogger\backups directory.
I have the following code..
{code}
procedure TMainForm.btnBackupLogClick(Sender: TObject);
var
 TablesToBackup: TStrings;
begin
  TablesToBackup:=TStringList.Create;
  try
   //
   dmLogger.ADCDB.CloseDataSets;
   //
     with dmLogger.ADCDB do
        begin
        with TablesToBackup do
           begin
           Add('TravelLog');
           end;
        if Backup('E:\DLogger\Backups\DLogger - '+ StringReplace(DateToStr(Date),'/','',[rfReplaceAll])+'.bkp',
         'Daily Backup for '+DateToStr(Date),
         6,
         TablesToBackup) then
           ShowMessage('Backup was successful')
        else
           ShowMessage('Backup failed');
        end;
  finally
     TablesToBackup.Free;
  end;
  //
   dmLogger.ttTravelLog.Open;
   dmLogger.ttLocations.Open;
   //
end;
{code}
Unfortunately this keeps coming back with Backup failed.  Frown

What have I missed please?

Regards & TIA,
Ian
Sat, Jul 30 2022 12:21 AMPermanent Link

Ian Branch

Avatar

Forgot to mention - It is a Local Database, not C/S.
Sat, Jul 30 2022 2:50 AMPermanent Link

Raul

Team Elevate Team Elevate

On 7/29/2022 11:25 PM, Ian Branch wrote:
> Hi Team,
> Win 1, D11.1, latest DBISAM.
> The App & database are in the e:\dlogger directory.
> I want to just backup and later restore just the TravelLog data.
> I want the backup file to go into the e:\dlogger\backups directory.

Does folder exist already ?

> I have the following code..

> Unfortunately this keeps coming back with Backup failed.  Frown
>
> What have I missed please?

I would suggest add OnBackupLog event handler and see what gets logged

Raul
Sat, Jul 30 2022 4:38 AMPermanent Link

Ian Branch

Avatar

Hi Raul,
Yes, it does exist.
I will try the OnBackupLog even and see what happens.

Ian
Sat, Jul 30 2022 4:55 AMPermanent Link

Ian Branch

Avatar

Doh!!!
All for the sake of a space..  
I had this..Add('TravelLog');
Instead of this..Add('Travel Log');
All good now
Tks Raul.
Regards,
Ian
Image