Files
harbour-core/harbour/contrib/rddads
Mindaugas Kavaliauskas 9a0ebe20a8 2009-11-25 19:10 UTC+0200 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt)
* harbour/contrib/rddads/ads1.c
    * changed field type mapping of HB_FT_* define, ADS_* define, 
      DBCREATE()/DBSTRUCT() array type member. Now we have mapping 
      compatible to DBF files as much as possible.

    ; INCOMPATIBILITIES to old ads1.c:
      * ADS_VARCHAR is mapped to HB_FT_VARLENGTH instead of old mapping 
        to HB_FT_MEMO. HB_FT_MEMO has a fixed size in DBF (ex., 10), 
        but ADS_VARCHAR is variable length field, so, HB_FT_VARLENGTH
        much more correct
      * fieldinfo method (DBSTRUCT() at .prg level) returns one byte 
        field type if possible. The exceptions are RAW, CICHARACTER, 
        and VARBINARY fields. So, you'll get a DBF compatible type P 
        instead of IMAGE, B instead of DOUBLE, T instead of TIME, etc.
      Other field mappings are extension to existing code and should 
      not be seen as incompatibility to end used.

    ; Current field type mappings are:
        C; Character,n     HB_FT_STRING,n                      ADS_STRING
        N; Numeric,n,d     HB_FT_LONG,n,d                      ADS_NUMERIC
        D; Date,n          HB_FT_DATE,3 or 4 or 8              ADS_COMPACTDATE; ADS_DATE
        ShortDate          HB_FT_DATE,3                        ADS_COMPACTDATE
        L; Logical         HB_FT_LOGICAL,1                     ADS_LOGICAL
        M; Memo,n          HB_FT_MEMO,4 or 9 or 8              ADS_MEMO
        B; Double,,d       HB_FT_DOUBLE,8,d                    ADS_DOUBLE
        I; Integer,n       HB_FT_INTEGER, 2 or 4 or 8          ADS_SHORTINT; ADS_INTEGER; ADS_LONGLONG
        ShortInt           HB_FT_INTEGER,2                     ADS_SHORTINT
        Longlong           HB_FT_INTEGER,8                     ADS_LONGLONG
        P; Image           HB_FT_IMAGE,9 or 10                 ADS_IMAGE
        W; Binary          HB_FT_BLOB,4 or 9 or 10             ADS_BINARY
        Y; Money           HB_FT_CURRENCY,8,4                  ADS_MONEY
        Z; CurDouble,,d    HB_FT_CURDOUBLE,8,d                 ADS_CURDOUBLE
        T,4; Time          HB_FT_TIME,4                        ADS_TIME
        @; T,8; TimeStamp  HB_FT_TIMESTAMP,8                   ADS_TIMESTAMP
        +; AutoInc         HB_FT_AUTOINC,4                     ADS_AUTOINC
        ^; RowVersion      HB_FT_ROWVER,8                      ADS_ROWVERSION
        =; ModTime         HB_FT_MODTIME,8                     ADS_MODTIME
        Raw,n              HB_FT_STRING,n (+HB_FF_BINARY)      ADS_RAW
        Q; VarChar,n       HB_FT_VARLENGTH,n                   ADS_VARCHAR; ADS_VARCHAR_FOX
        VarBinary,n        HB_FT_VARLENGTH,n (+HB_FF_BINARY)   ADS_VARBINARY_FOX; ADS_RAW
        CICharacter,n      HB_FT_STRING,n                      ADS_CISTRING

    ; ADS help has many ambiguities. Here is the most important I found:
        * Both ADS_VARCHAR and ADS_VARCHAR_FOX defines exists, but 
          VarChar filed type is documented only for VFP DBFs. Does 
          commom DBF support this field type?
        * It is not clear what ADS_* define corresponds to VarBinary 
          field. Both ADS_VARBINARY_FOX and ADS_RAW does not sound 
          to be a good choice.
        * ADS documents field types CharacterNoCPTrans, MemoNoCPTrans, 
          VarCharNoCPTrans available in VFP tables, but no corresponding
          ADS_* defines exist. These type are not supported by RDDDADS.
        * Autoincrement field type in DBF is called "Autoinc", in ADT 
          "Autoicrement". Test shows that both name are acceptedt by 
          AdsCreateTable().
        * ADS_LONGLONG define exists, but LomgLong field type is not 
          documented at all. It is not clear how to pass field type to 
          AdsCreateTable(): "Integer,8" or "LongLong". Test required!
        * Can extended DBF types like ShortDate and Image be used with 
          VFP DBF files? (Some other field typess are defined twice 
          both in extended DBF and VFP DBF)
        * Documented field type ShortInteger generates 5012 ADS error on 
          AdsCreateTable(). A simple workaround used: "ShortInt" passed
          instead of documented field name.

    ! Some ANSI <-> OEM translations moved under ADS_USE_OEM_TRANSLATION
      switch (the other translations was already there)

    ; Please, test and report bugs.
2009-11-25 17:11:56 +00:00
..

/*
 * $Id$
 */

 RDD for Advantage Database Server
 Alexander Kresin <alex@belacy.belgorod.su>


 For using this RDD you need to have:
   ace32.dll  ( Advantage Client Engine ),
   axcws32.dll ( communication layer for remote server ) or
   adsloc32.dll ( local server )

   You need also to create ace32.lib with the help of implib.exe:
     implib ace32.lib ace32.dll

   For building executables don't forget to include the ace32.lib and
   rddads.lib to the make file or link script.

   You need also to include to your prg file following lines:

      REQUEST ADS

   and then you can set default RDD using one of the following functions:

      rddsetdefault( "ADT" )
      rddsetdefault( "ADSNTX" )
      rddsetdefault( "ADSCDX" )
      rddsetdefault( "ADSVFP" )

   You can also use:

      REQUEST ADT | ADSNTX | ADSCDX | ADSVFP

   instead of REQUEST ADS.

   for backward compatibility with old code it's possible to use also:
      rddsetdefault( "ADS" )
   and then
     SET FILETYPE TO NTX | CDX | ADT | VFP
   command or AdsSetFileType() function to set table type (default is CDX)

   By default RDD is tuned for remote server. To change this you may
   use commands, defined in ads.ch:

     SET SERVER LOCAL

   or function AdsSetServerType().