First, add a reference to Chilkat UnixCompress in your VB6 project…
Dim z As New UnixCompress
z.UnlockComponent "30-day trial" ‘ You can use your Chilkat Zip unlock code here…
fname = "myData.dat"
‘ file-to-file compression…
z.CompressFile fname, fname & ".Z"
‘ file-to-file uncompress
z.UncompressFile fname & ".Z", "u.dat"
‘ file-to-memory compression
Dim compressedData as Variant
compressedData = z.CompressFileToMem(fname)
‘ memory-to-memory uncompress
Dim uncompressedData as Variant
uncompressedData = z.UncompressMemory(compressedData)
‘ memory-to-file uncompress
z.UncompressMemToFile compressedData, fname
‘ memory-to-file compress
z.CompressMemToFile uncompressedData, "myData.dat.Z"
‘ file-to-memory uncompress
uncompressedData = z.UncompressFileToMem("myData.dat.Z")