ASTA uses a freeware LZH component for ASTA compression. You may also want to use the TAstaCompress class for your own compression. These LZH components may not be thread safe when an ASTA server is stressed. ASTA 2.5 introduces a new thread safe compression called ASTAZLib Compression using the zlib code from Borland but highly modified by ASTA user David Martin.
ASTA LZH compression is kept for backwards compatibility but it is recommended that AstaZLib compress be used.
Here is an example of how to use it.
Ac := TAstaCompress.Create;
Output := Ac.CompressString('Hello World');
output := Ac.DecompressString(output); //uncompressed
Also available are :
function DecompressString(S: string): string;
function CompressString(S: string): string;
The AstaClientDataSet has an SQLOption of soCompress that allows for any select sql to be compressed even if you have Compression turned off. Previously this option did not use any custom compression you may have implemented. By using a unit procedure variable you can now recompile your ASTA package, and override the default AstaCompression code with any type of
compression that you require. This will also allow you to add design time encryption also by adding your own encyrption routine to your compression routines. Asta Design Time Custom Compression Support for more info.
Note: ASTA LZH uses a popular freeware LZH component for ASTA compression. You may have a different version of this same LZH component on your computer and may get compile errors. To make sure that your ASTA programs and packages compile directly make sure your \Asta\Bin directory which contains the ASTA LZH version of the compression component is first in your path before any other versions of the LZH components that may exist in your machine.
Commercial libraries like VCLZip and Abbrevia from www.turbopower.com offer excellent Compression solutions.