Selecting file formats Professional
The ADS Server handles Clipper compatible and FoxPro compatible file formats (DBT, NTX versus FPT, CDX files) and when using ADS Server Version 6.xx or higher the properitary ADT file format. However when using the later, it must be considered that the resulting files can not be accessed using other xBase tools. Import of data into excel-sheet or query of data from within reporting tools will neither be possible using the ADT file format.
The desired file format can be selected by configuring the ADSDBE as outlined below. After configuring the ADSDBE_TBL_MODE all following DbCreate() operations create files according to the configured file format. Opening a table or index file requires that the file to be opened conforms with the configured file format. If this is not the case an open error is generated. Check the section about Configuration of the ADSDBE for details about ADSDBE configuration parameters.
1. DBFNTX configuration
01 DbeInfo( COMPONENT_DATA , ADSDBE_TBL_MODE, ADSDBE_NTX )
02 DbeInfo( COMPONENT_ORDER, ADSDBE_TBL_MODE, ADSDBE_NTX )
2. DBFCDX configuration
01 DbeInfo( COMPONENT_DATA , ADSDBE_TBL_MODE, ADSDBE_CDX )
02 DbeInfo( COMPONENT_ORDER, ADSDBE_TBL_MODE, ADSDBE_CDX )
3. ADT/ADI configuration
01 DbeInfo( COMPONENT_DATA , ADSDBE_TBL_MODE, ADSDBE_ADT )
02 DbeInfo( COMPONENT_ORDER, ADSDBE_TBL_MODE, ADSDBE_ADT )
Autosensing file formats
The Advantage database server is not able to automatically detect the file type when performing USE/DbUseArea() operations. However when being connected to a Database Dictionary the information stored in the dictionary is used by the ADS Server to decide which file format is needed to open the table. The following code shows how this can be achieved.
01 // load database engine and make it the default one
02 DbeLoad("ADSDBE")
03 DbeSetDefault("ADSDBE")
04
05 // configure the DBE to use the dictionary for file format specification
06 DbeInfo( COMPONENT_DATA , ADSDBE_TBL_MODE, ADSDBE_DATABASE )
07 DbeInfo( COMPONENT_ORDER, ADSDBE_TBL_MODE, ADSDBE_DATABASE )
08
09 // connect to a dictionary namend ProductGroup
10 oSession := DacSession():New("DBE=ADSDBE;SERVER=\\ALASKA01\ProductGroup")
11
12 // all future DbUseArea() or DbCreate() functions now use the
13 // the information from the dictionary to decide which file format
14 // must be used to open / create the table.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.