Simplicty and flexibility!

DataEase 8.5 - Using 7zip as a backup program from inside DE85.

Started by DataEase
You will need to Sign In to be able to comment on the Blog!

DataEase 8.5 - Using 7zip as a backup program from inside DE85.

Download Sample

As discussed the built in Backup/Restore was discontinued in 8.0 but the functions was retained for backward compatibility. Now in 8.5 the changes are so extensive that they no longer even work.

As stated a lot of our users use frequent "backups" as security for not loosing data so attached is a sample that will show you how you can do this from inside an application without the need to exit etc.

We have chose to use 7zip simply because it is free, it is compact, it is commandline and it will zip down files that is open in other programs (i.e. DataEase).

Download 7-Zip 15.14 (2015-12-31) for Windows:

Link Type Windows Description
Download .exe 32-bit x86 7-Zip for 32-bit Windows
Download .exe 64-bit x64 7-Zip for 64-bit Windows x64 (Intel 64 or AMD64)
Download .7z x86 / x64 7-Zip Extra: standalone console version, 7z DLL, Plugin for Far Manager
Download .7z Any 7-Zip Source code
Download .7z Any / x86 / x64 LZMA SDK: (C, C++, C#, Java)
Download .msi 32-bit x86 (alternative MSI installer) 7-Zip for 32-bit Windows
Download .msi 64-bit x64 (alternative MSI installer) 7-Zip for 64-bit Windows x64 (Intel 64 or AMD64)

You find the download links for 7-zip above.

When you have downloaded and installed 7-zip, you can run the attached sample.

We have "hard coded" the path to 7-zip so if you have installed it a different location than C:\Program Files (x86)\7-zip\ then amend the code in the sample. (We downloaded the x86 version on x64, if you download the x86 version on x86 it will simply be C:\Program Files\7-Zip\ and the same if you download the x64 version on x64).

7-zip will create sub-directories etc if they don't exist so use sub-directories as much as you like.

We generate the file name from data and time, but you can generate them as you please.

We use the switch -ssw which means that it will archive files that are opened shared which is what files in an active DataEase application are opened as. This way we will be able to backup the application when it is still being used which will make it much easier and flexible.

On the button we simply execute the command line generated in BackupProgram field.

ExecuteFile() was improved earlier in 8.5 and will now accept complex command lines....very convenient now ;-)

Good luck.

Written by DataEase 05/03/16 at 18:09:55 Dataease [{8}]FIVE