Topic: How to overwrite an existing file
hi,
How to create a folder and overwrite an existing file with script? Example below only works if the file does not exist.
procedure Form1_btBackup_OnClick (Sender: string; var Cancel: boolean);
begin
if 7 = MessageDlg('Create / Update the SqLiteDB? Best choice is every day on the end of the shift back it up.', mtConfirmation, mbYes + mbNo, 0) then
begin
Cancel := True; // I think it is not necessary
CopyFile('sqlite.db', 'Backup\sqlite.db'); // Application path
//CopyFile('sqlite.db', 'I:\TP2014\Backup\sqlite.db'); // Reserve path
//P:\C\CF\CF3\TEST GA en MB\TP2014\Backup\sqlite.db // Backup path workplace
end;
end;
Thanks