
#include 'CdxDbe.ch'
#include 'DbfDbe.ch'
#include 'FoxDbE.ch'
#include 'NtxDbe.ch'
#include 'Set.ch'
#include 'Collat.ch'
  ////////////
  //   DbeSys.prg
  /////
PROCEDURE DbeSys()
                  //
                  //    Set Collation para o uso do DbeInfo(COMPONENT_ORDER, CDXDBE_MODE, CDXDBE_VFOXPRO)
Set(_SET_COLLATION, COLLAT_ASCII)
                  //
                  //    Loading the basic Dbes
                        //       DBF Format
DbeLoad('dbfdbe', .t.)                             // Common DBF
DbeLoad('foxdbe', .t.)                             // Copmpatibility with FoxPro and FoxPro 2.x
                        //       Arquivos de índices
DbeLoad('ntxdbe', .t.)                             // NTX
DbeLoad('cdxdbe', .t.)                             // CDX

if !DbeBuild('FoxCdx', 'foxdbe', 'cdxdbe' )        // FoxPro using CDX indexes
   Stop_('FOXCDX Database-Engine: could not build engine', .f.)
endif
DbeInfo(COMPONENT_DATA,  FOXDBE_LOCKRETRY, 100000)
DbeInfo(COMPONENT_DATA,  FOXDBE_LOCKDELAY,     10)
DbeInfo(COMPONENT_DATA,  FOXDBE_LIFETIME,      20)

DbeInfo(COMPONENT_ORDER, CDXDBE_LOCKRETRY, 100000)
DbeInfo(COMPONENT_ORDER, CDXDBE_LOCKDELAY,     10)
DbeInfo(COMPONENT_ORDER, CDXDBE_MODE,  CDXDBE_VFOXPRO)   // If you opte for using CDXDBE_VFOXPRO you
                                                            // must Set Collation to ASCII before
                                                            // to crete the indexes
DbeInfo(COMPONENT_ORDER, DBE_LOCKMODE, LOCKING_EXTENDED)

if !DbeBuild('DbfCdx', 'dbfdbe', 'cdxdbe')          // 'DbfCdx' DBF using indexes CDX
   Stop_('DBFCDX Database-Engine: could not build engine', .f.)
endif
DbeInfo(COMPONENT_DATA , DBFDBE_LOCKRETRY, 100000)
DbeInfo(COMPONENT_DATA , DBFDBE_LOCKDELAY,     10)
DbeInfo(COMPONENT_DATA,  DBFDBE_LIFETIME,      20)

DbeInfo(COMPONENT_ORDER, CDXDBE_LOCKRETRY, 100000)
DbeInfo(COMPONENT_ORDER, CDXDBE_LOCKDELAY,     10)
DbeInfo(COMPONENT_ORDER, CDXDBE_MODE,  CDXDBE_VFOXPRO)   // If you opte for using CDXDBE_VFOXPRO you
                                                            // must Set Collation to ASCII before
                                                            // to crete the indexes
DbeInfo(COMPONENT_ORDER, DBE_LOCKMODE, LOCKING_EXTENDED)
                  //
                  //    Dbes for processing data and indexes
if !DbeBuild('DbfNtx', 'dbfdbe', 'ntxdbe')          // 'DbfNtx' := DBF + NTX
   Stop_('DBFNTX Database-Engine: could not build engine', .f.)
endif
DbeInfo(COMPONENT_DATA , DBFDBE_LOCKRETRY, 100000)
DbeInfo(COMPONENT_DATA , DBFDBE_LOCKDELAY,     10)
DbeInfo(COMPONENT_DATA,  DBFDBE_LIFETIME,      20)

DbeInfo(COMPONENT_ORDER, NTXDBE_LOCKRETRY, 100000)
DbeInfo(COMPONENT_ORDER, NTXDBE_LOCKDELAY,     10)

if !DbeBuild('FoxNtx', 'foxdbe', 'ntxdbe')
   Stop_('FOXNTX Database-Engine: could not build engine', .f.)
endif
DbeInfo(COMPONENT_DATA,  FOXDBE_LOCKRETRY, 100000)
DbeInfo(COMPONENT_DATA,  FOXDBE_LOCKDELAY,     10)
DbeInfo(COMPONENT_DATA,  FOXDBE_LIFETIME,      20)

DbeInfo(COMPONENT_ORDER, NTXDBE_LOCKRETRY, 100000)
DbeInfo(COMPONENT_ORDER, NTXDBE_LOCKDELAY,     10)
DbeInfo(COMPONENT_ORDER, DBE_LOCKMODE, LOCKING_EXTENDED)
                  //
                  //       Dbes for text usind are loaded last
                  //               conversão de DBF no programa CabFiles.prg
DbeLoad('deldbe', .f.)                             // Delimited
DbeLoad('sdfdbe', .f.)                             // SDF
                  //
                  //    Default
DbeSetDefault('FoxCdx')
RETURN