<< Click to Display Table of Contents >> Navigation: Apollo VCL Components > Technical Information > File Formats Supported |
The Apollo database engine provides support for the table, memo, and index files used by Clipper, FoxPro, and HiPer-SIx. Brief descriptions of each of these file formats, and the advantages of one over the other, are listed below.
TableType: ttSXFOX
Engine file: ApolloCDX9.DLL
FoxPro uses the same table format (.DBF) as dBASE and Clipper. However, the FoxPro memo file format (.FPT) is completely different.
The .FPT memo format supports an adjustable block size. This does not mean that you can randomly change the block size being used throughout the same .FPT file, but that the entire file can use any block size as low as 1 byte and as high as 1024. Under Apollo, this block size can be set with TApolloTable's SetMemoBlockSize method. Because of this smaller block size, there is generally less white space in the file when compared to a Clipper or dBASE .DBT memo file containing the same information.
If FoxPro compatibility is specifically your reason for using this format, you should not set the block size to a value less than 32, as this is the smallest FoxPro itself supports.
FoxPro .FPT memos use the first eight bytes of each entry to store the type and length of the entry. Since the length is being stored up front, FoxPro memo files do not need to terminate the entry with ASCII 26 or any other special character. Because of this, .FPT memo files can offer support for binary data (BLOB) storage.
FoxPro supports single-order .IDX and compound .CDX index files. A .CDX file is similar to a bunch of .IDX files stacked on top of each other. A .CDX file with the same base name as the table is considered "structural" and is opened automatically when the table is opened. Both the .IDX and .CDX formats compress their key data, resulting in index files that can be 90% smaller than the equivalent Clipper (.NTX) or dBASE (.NDX/.MDX) index file. TApolloTable's FoxPro driver (ttSXFOX) should be used when FoxPro-compatibility is required.
TableType: ttSXNTX
Engine file: ApolloNTX7.DLL
Clipper uses the same basic data file formats as dBASE III+ used to use. The table is a .DBF file format, and the memo files are a .DBT file format. Note that this .DBT memo format is different than the .DBT memo format introduced in dBASE IV.
Natively, CA-Clipper .DBF/.DBT files use the .NTX index engine. In addition to supporting this native combination, Apollo also allows the.NSX index engine to be used with .CA-Clipper DBF/.DBT files. This is achieved by calling TApolloEnv.SysProp( SDE_SP_SETDBTNSX, Pointer(1) ).
The .DBT memo format uses fixed 512 byte blocks for each memo entry. This means that a memo entry that simply contains the text "This is a test" would still require 512 bytes. If an existing entry was 500 bytes long, and 20 bytes of new text were added, the total length would exceed the currently allocated space, and the entire contents of the memo entry would be moved to two new blocks at the end of the .DBT file (if they were not at the end already), and the old block would be abandoned.
Clipper .DBT memos do not store the length of an entry anywhere, so each entry is terminated with an ASCII 26. It is because of this that Clipper and dBASE III+ .DBT memos do not support BLOB storage. A binary entry could contain any of the 256 ASCII characters and, if the middle of the entry contained an ASCII 26, Clipper would stop reading the data out at that point.
Clipper .NTX index files are similar as well to the old dBASE III+ .NDX index format, but the specific differences in the formats are enough to make them incompatible with one another. The similarities are that both are single-order indexes, which means you have one index order per disk file. Neither Clipper .NTXs or dBASE .NDXs perform any type of compression on the index keys at all. Therefore, these index files can be fairly large when compared to more modern index formats.
Due to the large size of the Clipper index and memo file formats, TApolloTable's Clipper driver (ttSXNTX) should be used only when Clipper-compatibility is required.
TableType: ttSXNSX
Engine file: SDENSX7.DLL
HiPer-SIx tables are the basic format (.DBF) as dBASE, Clipper, and FoxPro. However, the HiPer-SIx memo (.SMT) and index (.NSX) file formats are completely different.
As with FoxPro's .FPT memos, the .SMT memo format supports an adjustable block size. This block size can be set as low as 1 with TApolloTable's SetMemoBlockSize method. Because of this smaller block size, there is generally less white space in the file when compared to a Clipper or dBASE .DBT memo file containing the same information.
While FoxPro .FPT memos use the first eight bytes of each entry to store the type and length of the entry, the HiPer-SIx driver stores this same information as part of the 10-byte MEMO field in the .DBF file itself. This frees up the first eight bytes of each .SMT entry to hold data. This also eliminates one disk read, which can improve data access speeds. As with FoxPro .FPT memos files, since .SMT memo files know the length of the entry, they also offer support for binary data (BLOB) storage.
The same HiPer-SIx .NSX index format can be used as a single-order index (like a FoxPro .IDX index) or as a compound index file (like a FoxPro .CDX index). An .NSX file with the same base name as the table is considered "structural" and is opened automatically when the table is opened. As with FoxPro .CDX indexes, the .NSX format compresses its key data resulting in very small index files. The compression used in .NSX indexes is more thorough than that used in FoxPro's index files, especially when dealing with indexes built on multiple fields (i.e., "LAST + FIRST").
TApolloTable's HiPer-SIx driver (ttSXNSX) should be used when neither Clipper or FoxPro-compatibility is required, and when the smallest and fastest overall files are desired.