Delphi Database, Delphi Components from ComponentAce
Products Download Order Contact us
Transaction Example
Top 


The following example shows how to use transaction system:

with Archiver do
begin
FileName := 'C:\TEST\test.zip';

// Create a new archive file
OpenArchive(fmCreate);

// Set path to folder with some text files to BaseDir
BaseDir := 'C:\SOURCE_FOLDER';

// Start a transaction
BeginUpdate;

// Add all files and directories from 'C:\SOURCE_FOLDER' to the archive
try
AddFiles('*.*');
except

// If errors occurs rollback transaction. All modifications will be cancelled.
CancelUpdate;

// Close archive and exit current procedure
CloseArchive;
Exit;
end;

// Set path to folder with some HTML files to BaseDir
BaseDir := 'C:\SOURCE_FOLDER1\';


// Add all HTML files from 'C:\SOURCE_FOLDER1' to the archive
try
AddFiles('*.htm?');
except

// If errors occurs rollback transaction. All modifications will be cancelled.
CancelUpdate;

// Close archive and exit current procedure
CloseArchive;
Exit;
end;

// Commit a transaction. All modifications will be saved.
EndUpdate;


// Close the archive
CloseArchive;
end;
        © 2003 - 2024 ComponentAce  | .net zip component | barcode for .net | delphi zip component | delphi database Apr 19, 2024 
        © 2003 - 2024 ComponentAce  | .net zip component | barcode for .net | delphi zip component | delphi database Apr 19, 2024