Topic: backup

Take a backup copy
And upload it to Google Drive

Post's attachments

Attachment icon backup.rar 293.83 kb, 53 downloads since 2023-09-06 

Re: backup

An implementation is missing for an assertion, and a few right key words are missing for a request for help.

Визуальное программирование: блог и телеграм-канал.

Re: backup

k245 wrote:

An implementation is missing for an assertion, and a few right key words are missing for a request for help.


I want the program to make a backup copy of the databases and sync them to my Google Drive account

Re: backup

Is there anyone help me in this matter

Re: backup

I think it's difficult to create with mvd on clear fast script. I prefer to create a python script and convert it to exe file. Then start script with OpenFile function.

Re: backup

ms2014m wrote:

Is there anyone help me in this matter

Я пользуюсь яндекс диском, я просто копирую скриптом БД в папку диска на ПК и эта папка сама синхронизируется, гугл диск должен работать подобным образом
 
I use Yandex disk, I just copy the database script to the disk folder on the PC and this folder synchronizes itself, Google disk should work in a similar way

Re: backup

pavlenko.vladimir.v wrote:
ms2014m wrote:

Is there anyone help me in this matter

Я пользуюсь яндекс диском, я просто копирую скриптом БД в папку диска на ПК и эта папка сама синхронизируется, гугл диск должен работать подобным образом
 
I use Yandex disk, I just copy the database script to the disk folder on the PC and this folder synchronizes itself, Google disk should work in a similar way



Can you help me do this through the attached program
I made a copy according to my calculations, and I want to know how to restore this copy to the program again by adding a restore button.

Re: backup

ms2014m wrote:

Can you help me do this through the attached program
I made a copy according to my calculations, and I want to know how to restore this copy to the program again by adding a restore button.

making a copy

CopyFile('sqlite.db', 'Backup\backup '+ FormatDateTime('dd-mm-yyyy', now)+'.db'); 

 
restore a copy

Form1.SQLConnection.Connected := False;
CopyFile(YOU_FILE, 'sqlite.db'); 

Re: backup

pavlenko.vladimir.v wrote:
ms2014m wrote:

Can you help me do this through the attached program
I made a copy according to my calculations, and I want to know how to restore this copy to the program again by adding a restore button.

making a copy

CopyFile('sqlite.db', 'Backup\backup '+ FormatDateTime('dd-mm-yyyy', now)+'.db'); 

 
restore a copy

Form1.SQLConnection.Connected := False;
CopyFile(YOU_FILE, 'sqlite.db'); 

Thank you very much
Could you please add these codes in the attached project? I am trying to add them, but it does not work

Post's attachments

Attachment icon backup.rar 293.83 kb, 47 downloads since 2023-09-09 

10 (edited by pavlenko.vladimir.v 2023-09-09 01:34:50)

Re: backup

ms2014m wrote:

Could you please add these codes in the attached project? I am trying to add them, but it does not work

https://myvisualdatabase.com/forum/misc.php?action=pun_attachment&item=9856&download=0

Post's attachments

Attachment icon 2023-09-09_05-53-49 (2).png 408.34 kb, 15 downloads since 2023-09-09 

Re: backup

ms2014m wrote:

Could you please add these codes in the attached project? I am trying to add them, but it does not work

procedure Form1_Button6_OnClick (Sender: TObject; var Cancel: boolean);
var
openDialog:TOpenDialog;
begin

  openDialog := TOpenDialog.Create(Form1);
  openDialog.Title := 'Выбор копии';
  openDialog.Options := ofHideReadOnly+ofEnableSizing;
  openDialog.Filter := 'файлы SQLite |*.db|';

  openDialog.InitialDir := ExtractFilePath(Application.ExeName)+'Backup';

  if openDialog.Execute then
  begin
    Form1.SQLConnection.Connected := False;
    if CopyFile(openDialog.fileName, 'sqlite.db') then
    begin
      Form1.TableGrid1.dbUpdate;
      showmessage('OK');
    end;
  end;
  openDialog.Free;
end;

procedure Form1_Button7_OnClick (Sender: TObject; var Cancel: boolean);
begin
  if CopyFile('sqlite.db', 'Backup\backup_'+FormatDateTime('yy.mm.dd_HH.MM.SS',Now) +'.db') then showmessage('OK');
end;
Post's attachments

Attachment icon test.rar 6.44 kb, 48 downloads since 2023-09-09 

Re: backup

pavlenko.vladimir.v wrote:
ms2014m wrote:

Could you please add these codes in the attached project? I am trying to add them, but it does not work

procedure Form1_Button6_OnClick (Sender: TObject; var Cancel: boolean);
var
openDialog:TOpenDialog;
begin

  openDialog := TOpenDialog.Create(Form1);
  openDialog.Title := 'Выбор копии';
  openDialog.Options := ofHideReadOnly+ofEnableSizing;
  openDialog.Filter := 'файлы SQLite |*.db|';

  openDialog.InitialDir := ExtractFilePath(Application.ExeName)+'Backup';

  if openDialog.Execute then
  begin
    Form1.SQLConnection.Connected := False;
    if CopyFile(openDialog.fileName, 'sqlite.db') then
    begin
      Form1.TableGrid1.dbUpdate;
      showmessage('OK');
    end;
  end;
  openDialog.Free;
end;

procedure Form1_Button7_OnClick (Sender: TObject; var Cancel: boolean);
begin
  if CopyFile('sqlite.db', 'Backup\backup_'+FormatDateTime('yy.mm.dd_HH.MM.SS',Now) +'.db') then showmessage('OK');
end;



Thank you very much
Everything works fine now