home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bde / sdkinc.pak / IDAPI.H < prev   
Encoding:
C/C++ Source or Header  |  1997-07-24  |  232.6 KB  |  4,967 lines

  1. //              idapi.h - main include file for idapi clients
  2. //
  3. // $Revision:   3.99  $
  4.  
  5.  
  6. #ifndef DBI_H
  7. #define DBI_H
  8. #ifdef __cplusplus
  9.     extern "C" {
  10. #endif // __cplusplus
  11.  
  12.  
  13. #define DBIINTFVER         119                  // Version of the interface
  14. #define DBIENGVERSION      120                  // Version of the engine (1.20)
  15.  
  16.  
  17. // assume byte packing throughout
  18. #if ! (defined(lint) || defined(_lint))
  19. #  ifndef RC_INVOKED
  20. #    if ( _MSC_VER >= 800 ) || (defined(__BORLANDC__) && defined(__FLAT__))
  21. #      pragma warning(disable:4103)
  22. #      if !(defined( MIDL_PASS )) || defined( __midl )
  23. #        pragma pack(push)
  24. #      endif
  25. #      pragma pack(1)
  26. #    elif defined(__BORLANDC__) && !defined(__FLAT__)
  27. #      pragma option -a-
  28. #    else
  29. #      pragma pack(1)
  30. #    endif
  31. #  endif // ndef RC_INVOKED
  32. #endif // ! (defined(lint) || defined(_lint))
  33.  
  34. #ifndef NODBITYPES
  35.  
  36. //-----------------------------------------------------------------------
  37. //     DBI types
  38. //-----------------------------------------------------------------------
  39.  
  40.  
  41. // sdk debug layer defines
  42. #define         DEBUGON         0x1
  43. #define         OUTPUTTOFILE    0x2
  44. #define         FLUSHEVERYOP    0x8
  45. #define         APPENDTOLOG     0x10
  46.  
  47.  
  48.  
  49.  
  50. // Constants
  51.  
  52. #define DBIMAXNAMELEN         31            // Name limit (table, field etc)
  53. #define DBIMAXSPNAMELEN       64            // Max stored procedure name length
  54. #define DBIMAXFLDSINKEY       16            // Max fields in a key
  55. #define DBIMAXKEYEXPLEN      220            // Max Key expression length
  56. #define DBIMAXEXTLEN           3            // Max file extension len, not incl. dot (excluding zero termination)
  57. #if defined(__WIN32__)
  58. #define DBIMAXTBLNAMELEN     260            // Max table name length
  59. #define DBIMAXDRIVELEN       127            // Max drive length
  60. #define DBIMAXPATHLEN        260            // Max path+file name len (excluding zero termination)
  61. #else
  62. #define DBIMAXTBLNAMELEN     127            // Max table name length
  63. #define DBIMAXDRIVELEN         2            // Max drive length
  64. #define DBIMAXPATHLEN         81            // Max path+file name len (excluding zero termination)
  65. #endif // defined(WIN32)
  66.  
  67. #define DBIMAXMSGLEN         127            // Max message len (allocate 64)
  68. #define DBIMAXVCHKLEN        255            // Max val check len
  69. #define DBIMAXPICTLEN        175            // Max picture len   //Verify this - VJ
  70. #define DBIMAXFLDSINSEC      256            // Max fields in security spec
  71.  
  72. #define DBIMAXSCFIELDS        16            // max nbr of fields in a config section
  73. #define DBIMAXSCFLDLEN       128            // max field length
  74. #define DBIMAXSCRECSIZE     2048            // max rec size
  75.  
  76. #define DBIMAXUSERNAMELEN      14           // Max user name (general)
  77. #define DBIMAXXBUSERNAMELEN    12           // Max user name length (xBASE)
  78. #define DBIMAXBOOKMARKLEN    4104           // Max Bookmark length
  79.  
  80. #if defined(__FLAT__)
  81. #ifdef far
  82. #undef far
  83. #endif // far
  84. #define far
  85. #endif // defined __FLAT__
  86.  
  87. #ifndef NODBIBASETYPES
  88.  
  89. #ifndef TRUE
  90. #  define TRUE 1
  91. #endif // TRUE
  92. #ifndef FALSE
  93. #  define FALSE 0
  94. #endif // FALSE
  95.  
  96. //For pointers
  97. #ifndef NULL
  98. #  define NULL (0)
  99. #endif // NULL
  100.  
  101. #if defined(__WIN32__) || defined (__NT__)
  102.    #if !defined(VOID)
  103.        #define VOID    void
  104.        typedef char CHAR;                     // from winnt.h
  105.        typedef short SHORT;
  106.        typedef long LONG;
  107.    #endif
  108. #else
  109.    #if !defined(VOID)
  110.       #define VOID    void
  111.    #endif // !defined(VOID)
  112.    typedef char CHAR;                     // from windows.h
  113. #endif // defined(WIN32) && !defined(VOID)
  114.  
  115. #ifndef _WINDEF_
  116. typedef unsigned char       BYTE;
  117. #endif
  118.  
  119. #ifndef INT8
  120. #  define INT8    char
  121. #endif // INT8
  122.  
  123. #ifndef UINT8
  124. #  define UINT8   unsigned char
  125. #endif // UINT8
  126.  
  127. #ifndef INT16
  128. #if defined(__FLAT__)
  129. #  define INT16   short
  130. #else
  131. #  define INT16   int
  132. #endif // defined(__FLAT__)
  133. #endif // INT16
  134.  
  135. #ifndef UINT16
  136. #if defined(__FLAT__)
  137. #  define UINT16  unsigned short
  138. #else
  139. #  define UINT16  unsigned int
  140. #endif // defined(__FLAT__)
  141. #endif // UINT16
  142.  
  143. #ifndef INT32
  144. #  define INT32   long
  145. #endif // INT32
  146. #ifndef UINT32
  147. #  define UINT32  unsigned long
  148. #endif // UINT32
  149.  
  150. typedef int BOOL;                      // from windows.h
  151.  
  152. typedef unsigned char BOOL8;
  153. typedef short         BOOL16;
  154.  
  155. #endif // NODBIBASETYPES
  156.  
  157. typedef double              DFLOAT;
  158.  
  159. typedef long      DBIDATE;
  160. typedef long      TIME;
  161. typedef double    TIMESTAMP;
  162.  
  163. typedef UINT32    hDBICfg;
  164.  
  165. typedef VOID      far *pVOID;
  166. typedef pVOID     far *ppVOID;
  167. typedef CHAR      far *pCHAR;
  168. typedef const CHAR far *pCCHAR;
  169. typedef BYTE      far *pBYTE;
  170. typedef INT8      far *pINT8;
  171. typedef UINT8     far *pUINT8;
  172. typedef INT16     far *pINT16;
  173. typedef UINT16    far *pUINT16;
  174. typedef INT32     far *pINT32;
  175. typedef UINT32    far *pUINT32;
  176. typedef DFLOAT    far *pDFLOAT;      
  177. typedef DBIDATE   far *pDBIDATE;
  178. typedef TIME      far *pTIME;
  179. typedef BOOL      far *pBOOL;
  180. typedef BOOL16    far *pBOOL16;
  181. typedef TIMESTAMP far *pTIMESTAMP;
  182.  
  183. #if !defined(__WIN32__) || (defined(__WATCOMC__) && !defined (__NT__))
  184. #define FLOAT     DFLOAT            // for compatibility with BDE 2.0
  185. #define pFLOAT    pDFLOAT
  186. #define DATE      DBIDATE
  187. #define pDATE     pDBIDATE
  188. #endif // WIN32
  189.  
  190. typedef pBYTE     far *ppBYTE;
  191. typedef pCHAR     far *ppCHAR;
  192. typedef pBOOL     far *ppBOOL;
  193. typedef pBOOL16   far *ppBOOL16;
  194.  
  195. typedef hDBICfg   far *phDBICfg;
  196.  
  197.  
  198. // Constants
  199.  
  200. //===========================================================================
  201. //                            G e n e r a l
  202. //===========================================================================
  203.  
  204. #if defined(__FLAT__)
  205. #define DBIFN  __stdcall               // All functions are this type
  206. #else
  207. #define DBIFN  __pascal far            // All functions are this type
  208. #endif // define(__FLAT__)
  209. typedef UINT16          DBIResult;     // Function result
  210. typedef DBIResult  far *pDBIResult;    // Function result pointer
  211.  
  212. typedef UINT32           hDBIObj;      // Generic object handle
  213.  
  214. typedef hDBIObj          hDBIDb;       // Database handle
  215. typedef hDBIObj          hDBIQry;      // Query handle
  216. typedef hDBIObj          hDBIStmt;     // Statement handle ("new query")
  217. typedef hDBIObj          hDBICur;      // Cursor handle
  218. typedef hDBIObj          hDBISes;      // Session handle
  219. typedef hDBIObj          hDBIXlt;      // Translation handle
  220.  
  221. typedef hDBIObj    far *phDBIObj;      // pointer to generic object handle
  222. typedef hDBIDb     far *phDBIDb;       // pointer to Database  handle
  223. typedef hDBIQry    far *phDBIQry;      // pointer to Query     handle
  224. typedef hDBIStmt   far *phDBIStmt;     // pointer to Statement handle
  225. typedef hDBICur    far *phDBICur;      // pointer to Cursor    handle
  226. typedef hDBISes    far *phDBISes;      // pointer to Session   handle
  227. typedef hDBIXlt    far *phDBIXlt;      // pointer to Translation handle
  228.  
  229. typedef UINT32          hDBIXact;      // Transaction handle
  230. typedef hDBIXact   far *phDBIXact;     // pointer to Transaction handle
  231.  
  232. // typedefs for buffers of various common sizes:
  233. //
  234. typedef CHAR   DBIPATH    [DBIMAXPATHLEN+1];     // holds a DOS path
  235. typedef CHAR   DBINAME    [DBIMAXNAMELEN+1];     // holds a name
  236. typedef CHAR   DBIEXT     [DBIMAXEXTLEN+1];      // holds an extension EXT
  237. typedef CHAR   DBIDOTEXT  [DBIMAXEXTLEN+2];      // holds an extension EXT including '.'
  238. typedef CHAR   DBIDRIVE   [DBIMAXDRIVELEN+1];    // holds a drive name
  239. typedef CHAR   DBITBLNAME [DBIMAXTBLNAMELEN+1];  // holds a table name
  240. typedef CHAR   DBISPNAME  [DBIMAXSPNAMELEN+1];   // holds a stored procedure name
  241. typedef CHAR   DBIUSERNAME[DBIMAXUSERNAMELEN+1]; // holds a user name
  242. typedef UINT16 DBIKEY     [DBIMAXFLDSINKEY];     // holds list of fields in a key
  243. typedef CHAR   DBIKEYEXP  [DBIMAXKEYEXPLEN+1];   // holds a key expression
  244. typedef BYTE   DBIVCHK    [DBIMAXVCHKLEN+1];     // holds a validity check
  245. typedef CHAR   DBIPICT    [DBIMAXPICTLEN+1];     // holds a picture (Pdox)
  246. typedef CHAR   DBIMSG     [DBIMAXMSGLEN+1];      // holds an error message
  247.  
  248.  
  249. //===========================================================================
  250. //                            Environmental
  251. //===========================================================================
  252.  
  253. typedef struct                            // Struct for defining the environ.
  254.    {
  255.       DBIPATH        szWorkDir;                 // Working directory
  256.       DBIPATH        szIniFile;                 // Configuration file
  257.       BOOL16         bForceLocalInit;           // Force local initialization
  258.       DBINAME        szLang;                    // System language driver 
  259.       DBINAME        szClientName;              // Client name (documentary)
  260.    } DBIEnv;
  261. typedef DBIEnv far   *pDBIEnv;
  262.  
  263. //============================================================================
  264. //                   System Info
  265. //============================================================================
  266.  
  267. typedef struct                         // System Version Info
  268.    {
  269.       UINT16         iVersion;            // Engine version
  270.       UINT16         iIntfLevel;          // Client Interface level
  271.       DBIDATE        dateVer;             // Version date (Compile/Release)
  272.       TIME           timeVer;             // Version time (Compile/Release)
  273.    } SYSVersion;
  274. typedef SYSVersion far *pSYSVersion;
  275.  
  276. typedef struct                         // System configuration (basic)
  277.    {
  278.       BOOL16         bLocalShare;         // If Local files will be shared
  279.       UINT16         iNetProtocol;        // Net Protocol (35, 40 etc.)
  280.       BOOL16         bNetShare;           // If Net files will be shared
  281.       DBINAME        szNetType;           // Network type
  282.       DBIUSERNAME    szUserName;          // Network user name
  283.       DBIPATH        szIniFile;           // Configuration file
  284.       DBINAME        szLangDriver;        // System language driver
  285.    } SYSConfig;
  286. typedef SYSConfig far *pSYSConfig;
  287.  
  288. typedef struct                         // System Status/Info
  289.    {
  290.       UINT16         iBufferSpace;           // in K
  291.       UINT16         iHeapSpace;             // in K
  292.       UINT16         iDrivers;               // Active/Loaded drivers
  293.       UINT16         iClients;               // Active clients 
  294.       UINT16         iSessions;              // Number of sessions (For all clients)
  295.       UINT16         iDatabases;             // Open databases
  296.       UINT16         iCursors;               // Number of cursors 
  297.    } SYSInfo; 
  298. typedef SYSInfo far * pSYSInfo;
  299.  
  300. typedef struct
  301.    {
  302.       DBINAME        szName;                 // Documentary name
  303.       UINT16         iSessions;              // Number of sessions
  304.       DBIPATH        szWorkDir;              // Working directory
  305.       DBINAME        szLang;                 // System language driver (Client supplied)
  306.    } CLIENTInfo;
  307. typedef CLIENTInfo far * pCLIENTInfo;
  308.  
  309. typedef struct
  310.    {
  311.       UINT16         iSession;               // Session id (1..n)
  312.       DBINAME        szName;                 // Documentary name
  313.       UINT16         iDatabases;             // Open databases
  314.       UINT16         iCursors;               // Open cursors
  315.       INT16          iLockWait;              // Lock wait time (in seconds)
  316.       DBIPATH        szNetDir;               // Net directory location
  317.       DBIPATH        szPrivDir;              // Current Private directory
  318.    } SESInfo; 
  319. typedef SESInfo far * pSESInfo;
  320.  
  321. //============================================================================
  322. //                             Table / Field Types
  323. //============================================================================
  324.  
  325. // Driver Types
  326.  
  327. #define szPARADOX       "PARADOX"
  328. #define szDBASE         "DBASE"
  329. #define szASCII         "ASCIIDRV"
  330.  
  331.  
  332. // Field Types (Logical)
  333.  
  334. #define fldUNKNOWN      0
  335. #define fldZSTRING      1                 // Null terminated string
  336. #define fldDATE         2                 // Date     (32 bit)
  337. #define fldBLOB         3                 // Blob
  338. #define fldBOOL         4                 // Boolean  (16 bit)
  339. #define fldINT16        5                 // 16 bit signed number
  340. #define fldINT32        6                 // 32 bit signed number
  341. #define fldFLOAT        7                 // 64 bit floating point
  342. #define fldBCD          8                 // BCD 
  343. #define fldBYTES        9                 // Fixed number of bytes
  344. #define fldTIME         10                // Time        (32 bit)
  345. #define fldTIMESTAMP    11                // Time-stamp  (64 bit)
  346. #define fldUINT16       12                // Unsigned 16 bit integer
  347. #define fldUINT32       13                // Unsigned 32 bit integer
  348. #define fldFLOATIEEE    14                // 80-bit IEEE float
  349. #define fldVARBYTES     15                // Length prefixed var bytes
  350. #define fldLOCKINFO     16                // Look for LOCKINFO typedef
  351.  
  352. #define MAXLOGFLDTYPES  17                // Number of logical fieldtypes
  353.  
  354. // Sub Types (Logical)
  355.  
  356. // fldFLOAT subtype
  357.  
  358. #define fldstMONEY      21                // Money
  359.  
  360. // fldBLOB subtypes
  361.  
  362. #define fldstMEMO          22             // Text Memo
  363. #define fldstBINARY        23             // Binary data
  364. #define fldstFMTMEMO       24             // Formatted Text
  365. #define fldstOLEOBJ        25             // OLE object (Paradox)
  366. #define fldstGRAPHIC       26             // Graphics object
  367. #define fldstDBSOLEOBJ     27             // dBASE OLE object
  368. #define fldstTYPEDBINARY   28             // Typed Binary data
  369.  
  370. // fldZSTRING subtype
  371.  
  372. #define fldstPASSWORD      1              // Password
  373.  
  374. // fldINT32 subtype
  375.  
  376. #define  fldstAUTOINC      29
  377.  
  378. // Paradox types (Physical)
  379.  
  380. #define  fldPDXCHAR        0x101        // Alpha    (string)
  381. #define  fldPDXNUM         0x102        // Numeric     
  382. #define  fldPDXMONEY       0x103        // Money 
  383. #define  fldPDXDATE        0x104        // Date
  384. #define  fldPDXSHORT       0x105        // Short
  385. #define  fldPDXMEMO        0x106        // Text Memo       (blob)
  386. #define  fldPDXBINARYBLOB  0x107        // Binary data     (blob)
  387. #define  fldPDXFMTMEMO     0x108        // Formatted text  (blob)
  388. #define  fldPDXOLEBLOB     0x109        // OLE object      (blob)
  389. #define  fldPDXGRAPHIC     0x10A        // Graphics object (blob)
  390. #define  fldPDXBLOB        fldPDXMEMO    
  391. #define  fldPDXLONG        0x10B        // Long
  392. #define  fldPDXTIME        0x10C        // Time
  393. #define  fldPDXDATETIME    0x10D        // Time Stamp
  394. #define  fldPDXBOOL        0x10E        // Logical
  395. #define  fldPDXAUTOINC     0x10F        // Auto increment (long)
  396. #define  fldPDXBYTES       0x110        // Fixed number of bytes
  397. #define  fldPDXBCD         0x111        // BCD (32 digits)
  398. #define  fldPDXUNICHAR     0x112        // not supported yet
  399.  
  400. // xBASE types (Physical)
  401.  
  402. #define  fldDBCHAR         0x201        // Char string
  403. #define  fldDBNUM          0x202        // Number
  404. #define  fldDBMEMO         0x203        // Memo          (blob)
  405. #define  fldDBBOOL         0x204        // Logical
  406. #define  fldDBDATE         0x205        // Date
  407. #define  fldDBFLOAT        0x206        // Float
  408. #define  fldDBLOCK         0x207        // Logical type is LOCKINFO
  409. #define  fldDBOLEBLOB      0x208        // OLE object    (blob)
  410. #define  fldDBBINARY       0x209        // Binary data   (blob)
  411. #define  fldDBBYTES        0x20A        // Only for TEMPORARY tables
  412.  
  413. // xBASE key types (Cannot be used as field types)
  414.  
  415. #define  fldDBKEYNUM       0x210
  416. #define  fldDBKEYBCD       0x211
  417.  
  418.  
  419. // Ascii types (Physical)
  420.  
  421. #define  fldASCCHAR         0x301       // Char string
  422. #define  fldASCNUM          0x302       // Number
  423. #define  fldASCBOOL         0x303       // Logical
  424. #define  fldASCDATE         0x304       // Date
  425. #define  fldASCFLOAT        0x305       // Float
  426. #define  fldASCLOCK         0x306       // Not used
  427. #define  fldASCTIMESTAMP    0x307       // TimeStamp
  428. #define  fldASCTIME         0x308       // Time
  429. #define  fldASCLONG         0x309       // Long
  430. #define  fldASCMONEY        0x30A       // Money
  431.  
  432.  
  433. //============================================================================
  434. //                    Field descriptor
  435. //============================================================================
  436.  
  437.  
  438. typedef enum                              // Field Val Check type
  439.    {
  440.       fldvNOCHECKS     = 0,                  // Does not have explicit val checks
  441.       fldvHASCHECKS    = 1,                  // One or more val checks on the field
  442.       fldvUNKNOWN      = 2                   // Dont know at this time
  443.    } FLDVchk;
  444.  
  445. typedef enum                              // Field Rights
  446.    {
  447.       fldrREADWRITE     = 0,                 // Field can be Read/Written
  448.       fldrREADONLY      = 1,                 // Field is Read only
  449.       fldrNONE          = 2,                 // No Rights on this field
  450.       fldrUNKNOWN       = 3                  // Dont know at this time
  451.    } FLDRights;
  452.  
  453. typedef struct {                          // Field Descriptor
  454.       UINT16         iFldNum;                // Field number (1..n)
  455.       DBINAME        szName;                 // Field name
  456.       UINT16         iFldType;               // Field type
  457.       UINT16         iSubType;               // Field subtype (if applicable)
  458.       INT16          iUnits1;                // Number of Chars, digits etc
  459.       INT16          iUnits2;                // Decimal places etc.
  460.       UINT16         iOffset;                // Offset in the record (computed)
  461.       UINT16         iLen;                   // Length in bytes (computed)
  462.       UINT16         iNullOffset;            // For Null bits (computed)
  463.       FLDVchk        efldvVchk;              // Field Has vcheck (computed)
  464.       FLDRights      efldrRights;            // Field Rights (computed)
  465.    } FLDDesc;
  466. typedef FLDDesc far *pFLDDesc;
  467.  
  468. //============================================================================
  469. //                    Index descriptor
  470. //============================================================================
  471.  
  472.  
  473. typedef struct                            // Index description
  474.    {
  475.       DBITBLNAME     szName;                 // Index name
  476.       UINT16         iIndexId;               // Index number
  477.       DBINAME        szTagName;              // Tag name (for dBASE)
  478.       DBINAME        szFormat;               // Optional format (BTREE, HASH etc)
  479.       BOOL16         bPrimary;               // True, if primary index
  480.       BOOL16         bUnique;                // True, if unique keys
  481.       BOOL16         bDescending;            // True, for descending index
  482.       BOOL16         bMaintained;            // True, if maintained index
  483.       BOOL16         bSubset;                // True, if subset index
  484.       BOOL16         bExpIdx;                // True, if expression index
  485.       UINT16         iCost;                  // Not used
  486.       UINT16         iFldsInKey;             // Fields in the key (1 for Exp)
  487.       UINT16         iKeyLen;                // Phy Key length in bytes (Key only)
  488.       BOOL16         bOutofDate;             // True, if index out of date                         
  489.       UINT16         iKeyExpType;            // Key type of Expression
  490.       DBIKEY         aiKeyFld;               // Array of field numbers in key
  491.       DBIKEYEXP      szKeyExp;               // Key expression
  492.       DBIKEYEXP      szKeyCond;              // Subset condition
  493.       BOOL16         bCaseInsensitive;       // True, if case insensitive index
  494.       UINT16         iBlockSize;             // Block size in bytes
  495.       UINT16         iRestrNum;              // Restructure number                  
  496.       UINT16         iUnUsed[16];
  497.    } IDXDesc; 
  498. typedef IDXDesc far *pIDXDesc;
  499.  
  500. //============================================================================
  501. //                    Validity check, Referential integrity descriptors
  502. //============================================================================
  503.  
  504.  
  505.  
  506. // Subtypes for Lookup
  507.  
  508. typedef enum                              // Paradox Lookup type
  509.    {
  510.       lkupNONE          = 0,                 // Has no lookup
  511.       lkupPRIVATE       = 1,                 // Just Current Field + Private
  512.       lkupALLCORRESP    = 2,                 // All Corresponding + No Help
  513.       lkupHELP          = 3,                 // Just Current Fld + Help and Fill
  514.       lkupALLCORRESPHELP= 4                  // All Corresponging + Help
  515.    } LKUPType;
  516.  
  517. #define TODAYVAL  2                       // for Min/Max/Def val flags
  518.  
  519.    // In VCHKDesc below, if any of bHasMinVal/bHasMaxVal/bHasDefVal
  520.    // = TODAYVAL, then TODAY is assumed.
  521.  
  522. typedef struct                            // Val Check structure
  523.    {
  524.       UINT16         iFldNum;                // Field number
  525.       BOOL16         bRequired;              // If True, value is required 
  526.       BOOL16         bHasMinVal;             // If True, has min value
  527.       BOOL16         bHasMaxVal;             // If True, has max value
  528.       BOOL16         bHasDefVal;             // If True, has default value
  529.       DBIVCHK        aMinVal;                // Min Value
  530.       DBIVCHK        aMaxVal;                // Max Value
  531.       DBIVCHK        aDefVal;                // Default value 
  532.       DBIPICT        szPict;                 // Picture string
  533.       LKUPType       elkupType;              // Lookup/Fill type
  534.       DBIPATH        szLkupTblName;          // Lookup Table name
  535.    } VCHKDesc;
  536. typedef VCHKDesc far *pVCHKDesc;
  537.  
  538. typedef enum                              // Ref integrity type
  539.    {
  540.       rintMASTER     = 0,                    // This table is Master
  541.       rintDEPENDENT  = 1                     // This table is Dependent
  542.    } RINTType;
  543.  
  544. typedef enum                              // Ref integrity action/qualifier
  545.    {
  546.       rintRESTRICT   = 0,                    // Prohibit operation
  547.       rintCASCADE    = 1                     // Cascade operation
  548.    } RINTQual;
  549.  
  550. typedef struct                            // Ref Integrity Desc
  551.    {  
  552.       UINT16         iRintNum;               // Ref integrity number
  553.       DBINAME        szRintName;             // A name to tag this integegrity constraint
  554.       RINTType       eType;                  // Whether master/dependent
  555.       DBIPATH        szTblName;              // Other table name
  556.       RINTQual       eModOp;                 // Modify qualifier
  557.       RINTQual       eDelOp;                 // Delete qualifier
  558.       UINT16         iFldCount;              // Fields in foreign key 
  559.       DBIKEY         aiThisTabFld;           // Fields in this table
  560.       DBIKEY         aiOthTabFld;            // Fields in other table
  561.    } RINTDesc;
  562. typedef RINTDesc far *pRINTDesc;
  563.  
  564.  
  565. //============================================================================
  566. //                    Security descriptor
  567. //============================================================================
  568. // Family rights
  569.  
  570. #define NOFAMRIGHTS     0x00                 // No Family rights
  571. #define FORMRIGHTS      0x01                 // Can change form
  572. #define RPTRIGHTS       0x02                 // Can change reports
  573. #define VALRIGHTS       0x04                 // Can change valchecks
  574. #define SETRIGHTS       0x08                 // Can change settings
  575. #define ALLFAMRIGHTS    (FORMRIGHTS | RPTRIGHTS | VALRIGHTS | SETRIGHTS)
  576.                                              // All family rights
  577.  
  578. typedef enum  {                           // Privileges
  579.       prvNONE        = 0,                    // No privilege
  580.       prvREADONLY    = 0x01,                 // Read only Table or Field
  581.       prvMODIFY      = 0x03,                 // Read and Modify fields (non-key)
  582.       prvINSERT      = 0x07,                 // Insert + All of above
  583.       prvINSDEL      = 0x0F,                 // Delete + All of above
  584.       prvFULL        = 0x1F,                 // Full Writes
  585.       prvUNKNOWN     = 0xFF                  // Unknown
  586.    } PRVType;
  587.  
  588.  
  589. typedef struct {                             // Security description
  590.       UINT16         iSecNum;                   // Nbr to identify desc
  591.       PRVType        eprvTable;                 // Table privileges
  592.       UINT16         iFamRights;                // Family rights      
  593.       DBINAME        szPassword;                // Null terminated string
  594.       PRVType        aprvFld[DBIMAXFLDSINSEC];  // Field level privileges (prvNONE/prvREADONLY/prvFULL)
  595.    } SECDesc;
  596. typedef SECDesc far *pSECDesc;
  597.  
  598.  
  599. //======================================================================
  600. //                         Miscellaneous
  601. //======================================================================
  602.  
  603. // Index Id used to open table without a default index (i.e. no order)
  604.  
  605. #define  NODEFAULTINDEX    0xFFFF
  606.  
  607.  
  608. //============================================================================
  609. //                    Object types
  610. //============================================================================
  611.  
  612. typedef enum
  613.    {
  614.        objSYSTEM                 = 1,      // System object
  615.        objSESSION                = 2,      // Session object
  616.        objDRIVER                 = 3,      // Driver object
  617.        objDATABASE               = 4,      // Database object
  618.        objCURSOR                 = 5,      // Cursor object
  619.        objSTATEMENT              = 6,      // Statement object
  620.        objCLIENT                 = 7,      // Client object
  621.        objDBSEC                  = 8       // DbSystem object (dBASE only)
  622.    }  DBIOBJType;
  623.  
  624. //============================================================================
  625. //                    Cursor properties 
  626. //============================================================================
  627.  
  628.  
  629. typedef enum                              // Database/Table Share type
  630.    {
  631.       dbiOPENSHARED     = 0,                 // Open shared  (Default)
  632.       dbiOPENEXCL       = 1,                 // Open exclusive
  633.    } DBIShareMode;
  634.  
  635. typedef enum                              // Database/Table Access type
  636.    {
  637.       dbiREADWRITE      = 0,                 // Read + Write   (Default)
  638.       dbiREADONLY       = 1                  // Read only
  639.    } DBIOpenMode;
  640.  
  641. typedef enum                              // Lock types (Table level)
  642.    {
  643.       dbiNOLOCK         = 0,                 // No lock   (Default)
  644.       dbiWRITELOCK      = 1,                 // Write lock
  645.       dbiREADLOCK       = 2                  // Read lock
  646.    } DBILockType;
  647.  
  648. typedef enum                              // Field translate mode
  649.    {
  650.       xltNONE        = 0,                    // No translation  (Physical Types)
  651.       xltRECORD      = 1,                    // Record level translation (not supported)
  652.       xltFIELD       = 2,                    // Field level translation (Logical types)
  653.    } XLTMode;
  654.  
  655. typedef enum                              // Update lock mode (SQL only)
  656.    {
  657.       updWHEREALL    = 0,                    // All fields in WHERE clause
  658.       updWHEREKEYCHG = 1,                    // Keyed and changed fields in WHERE clause
  659.       updWHEREKEY    = 2                     // Keyed fields in WHERE clause
  660.    } UPDLockMode;
  661.  
  662.  
  663. // Table levels 
  664.  
  665. #define TBLLEVEL3    3              // Paradox level 3 and dBASE level 3+
  666. #define TBLLEVEL4    4              // Paradox level 4 and dBASE level 4
  667. #define TBLLEVEL5    5              // Paradox level 5 and dBASE/Win
  668. #define FOXLEVEL25   25             // Fox Table (Ver 2.5)
  669.  
  670. typedef struct {                          // Virtual Table properties
  671.       DBITBLNAME     szName;                 // table name (no extension, if it can be derived)
  672.       UINT16         iFNameSize;             // Full file name size 
  673.       DBINAME        szTableType;            // Driver type 
  674.       UINT16         iFields;                // No of fields in Table
  675.       UINT16         iRecSize;               // Record size (logical record)
  676.       UINT16         iRecBufSize;            // Record size (physical record)
  677.       UINT16         iKeySize;               // Key size
  678.       UINT16         iIndexes;               // Number of indexes
  679.       UINT16         iValChecks;             // Number of val checks
  680.       UINT16         iRefIntChecks;          // Number of Ref Integrity constraints
  681.       UINT16         iBookMarkSize;          // Bookmark size
  682.       BOOL16         bBookMarkStable;        // Stable book marks
  683.       DBIOpenMode    eOpenMode;              // ReadOnly / RW
  684.       DBIShareMode   eShareMode;             // Excl / Share
  685.       BOOL16         bIndexed;               // Index is in use
  686.       INT16          iSeqNums;               // 1: Has Seqnums; 0: Has Record#
  687.                                              // <0 (-1, -2, ...): None (e.g. SQL)
  688.       BOOL16         bSoftDeletes;           // Supports soft deletes
  689.       BOOL16         bDeletedOn;             // If above, deleted recs seen
  690.       UINT16         iRefRange;              // Not used
  691.       XLTMode        exltMode;               // Translate Mode
  692.       UINT16         iRestrVersion;          // Restructure version number
  693.       BOOL16         bUniDirectional;        // Cursor is uni-directional
  694.       PRVType        eprvRights;             // Table  rights
  695.       UINT16         iFmlRights;             // Family rights      
  696.       UINT16         iPasswords;             // Number of Aux passwords
  697.       UINT16         iCodePage;              // Codepage (0 if unknown)
  698.       BOOL16         bProtected;             // Table is protected by password
  699.       UINT16         iTblLevel;              // Driver dependent table level
  700.       DBINAME        szLangDriver;           // Language driver name
  701.       BOOL16         bFieldMap;              // Field map active
  702.       UINT16         iBlockSize;             // Physical file blocksize in K 
  703.       BOOL16         bStrictRefInt;          // Strict referential integrity
  704.       UINT16         iFilters     ;          // Number of filters
  705.       BOOL16         bTempTable   ;          // Table is a temporary table
  706.       UINT16         iUnUsed[16];
  707.      } CURProps;
  708. typedef CURProps far *pCURProps;
  709.  
  710. //============================================================================
  711. //                   Record Properties
  712. //============================================================================
  713.  
  714.  
  715. typedef struct {                          // Record properties
  716.       UINT32         iSeqNum;                // When Seq# supported only
  717.       UINT32         iPhyRecNum;             // When Phy Rec#s supported only
  718.       BOOL16         bRecChanged;            // Not used
  719.       BOOL16         bSeqNumChanged;         // Not used
  720.       BOOL16         bDeleteFlag;            // When soft delete supported only
  721.    } RECProps;
  722. typedef RECProps far *pRECProps;
  723.  
  724.  
  725. //============================================================================
  726. //                   General properties  DbiGetProp/DbiSetProp
  727. //============================================================================
  728.  
  729.  
  730. // Cursor properties
  731. // General
  732.  
  733. #define  curMAXPROPS         0x00050000l   //ro UINT16   , Number of defined properties
  734. #define  curTABLENAME        0x00050001l   //ro pTBLNAME , Table name 
  735. #define  curTABLETYPE        0x00050002l   //ro pDBINAME , Table type
  736. #define  curTABLELEVEL       0x00050003l   //ro UINT16   , Table level 1..n
  737. #define  curFILENAME         0x00050004l   //ro pPATH    , Full filename  
  738. #define  curXLTMODE          0x00050005l   //rw XLTMode  , Translate mode
  739. #define  curSEQREADON        0x00050006l   //rw BOOL     , Sequential read mode hint ON
  740. #define  curONEPASSON        0x00050007l   //rw BOOL     , One pass mode hint ON
  741. #define  curUPDATETS         0x00050008l   //ro TIMESTAMP, Update timestamp
  742. #define  curSOFTDELETEON     0x00050009l   //rw BOOL     , Softdelete ON
  743. #define  curLANGDRVNAME      0x0005000Al   //ro pCHAR    , Symbolic language drv. name
  744. #define  curCURSORNAME       0x0005000Bl   //ro pCHAR    , name of the cursor
  745. #define  maxcurPROPS      11               // keep in sync when adding cursor properties
  746.  
  747. // Paradox specific
  748. #define  curPDXMAXPROPS      0x01050000l   //ro UINT16   , Number of defined properties
  749. #define  maxcurPDXPROPS   0
  750.  
  751. // DBase specific
  752. #define  curDBMAXPROPS       0x02050000l   //ro UINT16   , Number of defined properties
  753. #define  curINEXACTON        0x02050001l   //rw BOOL     , InExact match ON
  754. #define  curSHAREMODE        0x02050002l   //rw DBIShareMode, Share mode
  755. #define  maxcurDBPROPS    2
  756.  
  757. // Text Driver specific
  758. #define  curDELIMITALLFLDS   0x03050000l   //rw BOOL , Delimit all fields.
  759. #define  curUSESCHEMAFILE    0x03050001l   //rw BOOL , read schema from a file
  760.  
  761. // SQL Driver specific
  762. #define  curUPDLOCKMODE      0x04050000l   //rw UPDLockMode ,Update lock mode 
  763. #define  curNATIVEHNDL       0x04050001l   //ro pBYTE       ,Native cursor handle
  764.  
  765. // Driver properties
  766. // General
  767. #define  drvMAXPROPS         0x00030000l   //ro UINT16   , Number of defined properties
  768. #define  drvDRIVERTYPE       0x00030002l   //ro pDBINAME , Driver type
  769. #define  drvDRIVERVERSION    0x00030003l   //ro UINT16   , Driver version
  770. #define  maxdrvPROPS      2                // keep in sync when adding driver properties
  771.  
  772. // Database properties
  773. // General
  774. #define  dbMAXPROPS         0x00040000l   //ro UINT16   , Number of defined properties
  775. #define  dbDATABASENAME     0x00040001l   //ro pDBINAME , Database name/alias
  776. #define  dbDATABASETYPE     0x00040002l   //ro pDBINAME , Database type
  777. #define  dbDEFAULTDRIVER    0x00040003l   //rw pDBINAME , Default Driver name
  778. #define  dbPARAMFMTQMARK    0x00040004l   //rw BOOL     , Stmt param marker fmt = ?
  779. #define  dbUSESCHEMAFILE    0x00040005l   //rw BOOL , for text driver only.
  780. #define  maxdbPROPS       11              // keep in sync when adding ANY db properties
  781.  
  782. // SQL Driver specific
  783. #define  dbASYNCSUPPORT     0x04040000l   //ro BOOL     , Async. qry exec support
  784. #define  dbPROCEDURES       0x04040001l   //ro BOOL     , Stored procedure support
  785. #define  dbDEFAULTTXNISO    0x04040002l   //ro eXILType , Default transaction iso level
  786. #define  dbNATIVEHNDL       0x04040003l   //ro pBYTE    , Native connection handle
  787. #define  dbNATIVEPASSTHRUHNDL 0x04040004l //ro pBYTE    , Native passthru connection handle
  788. #define  dbSERVERVERSION    0x04040005l   //ro UINT16   , Major server version number
  789.  
  790. // Session properties
  791. // General
  792. #define  sesMAXPROPS         0x00020000l   //ro UINT16   , Number of defined properties
  793. #define  sesSESSIONNAME      0x00020001l   //ro pDBINAME , Name of seesion
  794. #define  sesNETFILE          0x00020002l   //rw pCHAR    , Full filename of netfile (MAXPATHLEN)
  795. #define  sesCFGMODE          0x00020003l   //rw CFGMode, Mode of configuration file.
  796. #define  sesDEFAULTDRIVER    0x00020004l   //rw pDBINAME, default driver name 
  797. #define  sesGROUPNAME        0x00020005l   //rw pCHAR, Security - user group name (dBASE)
  798. #define  sesUSERNAME         0x00020006l   //rw pCHAR, User Name
  799. #define  sesUSERPASSWORD     0x00020007l   //rw pCHAR, User password
  800. #define  sesSECFILENAME      0x00020008l   //rw pCHAR, Location of dBASE Security file
  801. #define  maxsesPROPS      8                // keep in sync when adding session properties
  802.  
  803. // System properties
  804. // General
  805. #define   sysMAXPROPS        0x00010000l   // ro UINT16  , Number of defined properties
  806. #define   sysLOWMEMUSAGE     0x00010001l   // ro UINT16  , Low memory usage in (k)
  807. #define   maxsysPROPS     1                // keep in sync when adding system properties
  808.  
  809. // Statement properties
  810. // General
  811. #define  stmtMAXPROPS        0x00060001l   //ro UINT16      Number of defined properties
  812. #define  stmtPARAMETERCOUNT  0x00060002l   //ro UINT16      Count of parameters
  813. #define  stmtPARAMETERDESCS  0x00060003l   //ro aFLDDesc    Array of parameters
  814. #define  stmtLANGDRVNAME     0x00060004l   //ro pCHAR       Symbolic language drv. name
  815. #define  stmtUNIDIRECTIONAL  0x00060010l   //rw BOOL        Cursor Unidirectional
  816. #define  stmtCURSORNAME      0x00060011l   //rw pCHAR       Cursor name
  817. #define  stmtNEWCONNECT      0x00060012l   //rw BOOL        Stmt on new connection
  818. #define  stmtNATIVEHNDL      0x00060013l   //ro pBYTE       Native statement handle
  819. #define  stmtROWCOUNT        0x00060014l   //ro UINT32      Rows effected by a stmt
  820. #define  maxstmtPROPS     19               // keep in sync when adding ANY stmt properties
  821.  
  822. // specific to QBE or local SQL
  823. #define  stmtANSTYPE         0x00060020l   //rw pBYTE       Table Type of Answer set
  824. #define  stmtLIVENESS        0x00060021l   //rw LIVENESS    Preference for canned/live answers
  825. #define  stmtQRYMODE         0x00060022l   //rw QryEvalMode Execute on server or local or either
  826. #define  stmtBLANKS          0x00060023l   //rw BOOL        True if blanks to be regarded as zeros. 
  827. #define  stmtDATEFORMAT      0x00060024l   //rw FMTDate     Date format
  828. #define  stmtNUMBERFORMAT    0x00060025l   //rw FMTNumber   Number format
  829. #define  stmtAUXTBLS         0x00060026l   //rw BOOL        True if QBE to create CHANGED, etc.
  830. #define  stmtTBLVECTOR       0x00060027l   //ro UINT16      Vector of tables generated by query.
  831. #define  stmtALLPROPS        0x00060028l   //rw QueryLowProps
  832. #define  stmtALLPROPSSIZE    0x00060029l   //rw INT16       size of QueryLowProps
  833. #define  stmtANSNAME         0x00060030l   //rw pBYTE       Answer Table Name.
  834.  
  835.  
  836. //============================================================================
  837. //                    Transactions
  838. //============================================================================
  839.  
  840. // Transaction support
  841.  
  842. typedef enum                           // Transaction isolation levels
  843.    {
  844.       xilDIRTYREAD,                    // Uncommitted changes read
  845.       xilREADCOMMITTED,                // Committed changes, no phantoms
  846.       xilREPEATABLEREAD                // Full read repeatability
  847.    } eXILType;
  848.  
  849. typedef enum                           // Transaction end control
  850.    {
  851.       xendCOMMIT,       // Commit transaction
  852.       xendCOMMITKEEP,   // Commit transaction, keep cursors
  853.       xendABORT         // Rollback transaction
  854.    } eXEnd;
  855.  
  856. typedef enum                           // Transaction end control
  857.    {
  858.       xsINACTIVE,       // Transaction inactive
  859.       xsACTIVE          // Transaction active
  860.    } eXState;
  861.  
  862. typedef struct
  863.    {
  864.       eXState        exState;          // xsActive, xsInactive
  865.       eXILType       eXIL;             // Xact isolation level
  866.       UINT16         uNests;           // Xact children
  867.    } XInfo, *pXInfo;
  868.  
  869.  
  870. //============================================================================
  871. //                         BookMark compares
  872. //============================================================================
  873.  
  874. typedef enum                              // Compare BookMark Results
  875.    {
  876.       CMPLess           = -1,             // Bkm1 < Bkm2
  877.       CMPEql            = 0,              // BookMarks are exactly the same
  878.       CMPGtr            = 1,              // Bkm1 > Bkm2
  879.       CMPKeyEql         = 2               // Only Bkm1.key_val = Bkm2.key_val
  880.    } CMPBkMkRslt;
  881. typedef CMPBkMkRslt far *pCMPBkMkRslt;
  882.  
  883.  
  884. //===========================================================================
  885. //                            Key searches
  886. //===========================================================================
  887.                
  888. typedef enum  {                           // Search condition for keys
  889.       keySEARCHEQ       = 0,                 // =
  890.       keySEARCHGT       = 1,                 // >
  891.       keySEARCHGEQ      = 2,                 // >=
  892.     } DBISearchCond;
  893.  
  894.  
  895. //============================================================================
  896. //                      Create/Restructure descriptor
  897. //============================================================================
  898.  
  899. typedef enum                              // Create/Restruct Operation type
  900.    {
  901.       crNOOP         = 0,                 
  902.       crADD          = 1,                    // Add a new element.
  903.       crCOPY         = 2,                    // Copy an existing element.
  904.       crMODIFY       = 3,                    // Modify an element.
  905.       crDROP         = 4,                    // Removes an element.
  906.       crREDO         = 5,                    // Reconstruct an element.
  907.       crTABLE        = 6,                    // Not used
  908.       crGROUP        = 7,                    // Not used
  909.       crFAMILY       = 8,                    // Not used
  910.       crDONE         = 9,                    // Used internally
  911.       crDROPADD      = 10                    // Used internally
  912.    } CROpType;
  913.  
  914. typedef CROpType far *pCROpType;
  915.  
  916. typedef struct                            // Create/Restruct Table descr
  917.    {
  918.       DBITBLNAME     szTblName;                 // TableName incl. optional path & ext
  919.       DBINAME        szTblType;                 // Driver type (optional)
  920.       DBIPATH        szErrTblName;              // Error Table name (optional)
  921.       DBINAME        szUserName;                // User name (if applicable)
  922.       DBINAME        szPassword;                // Password (optional) 
  923.       BOOL16         bProtected;                // Master password supplied in szPassword
  924.       BOOL16         bPack;                     // Pack table (restructure only) 
  925.  
  926.       UINT16         iFldCount;                 // Number of field defs supplied
  927.       pCROpType      pecrFldOp;                 // Array of field ops
  928.       pFLDDesc       pfldDesc;                  // Array of field descriptors
  929.  
  930.       UINT16         iIdxCount;                 // Number of index defs supplied
  931.       pCROpType      pecrIdxOp;                 // Array of index ops
  932.       pIDXDesc       pidxDesc;                  // Array of index descriptors
  933.  
  934.       UINT16         iSecRecCount;              // Number of security defs supplied
  935.       pCROpType      pecrSecOp;                 // Array of security ops
  936.       pSECDesc       psecDesc;                  // Array of security descriptors
  937.  
  938.       UINT16         iValChkCount;              // Number of val checks
  939.       pCROpType      pecrValChkOp;              // Array of val check ops
  940.       pVCHKDesc      pvchkDesc;                 // Array of val check descs
  941.  
  942.       UINT16         iRintCount;                // Number of ref int specs
  943.       pCROpType      pecrRintOp;                // Array of ref int ops
  944.       pRINTDesc      printDesc;                 // Array of ref int specs
  945.  
  946.       UINT16         iOptParams;                // Number of optional parameters
  947.       pFLDDesc       pfldOptParams;             // Array of field descriptors
  948.       pBYTE          pOptData;                  // Optional parameters
  949.  
  950.    } CRTblDesc;
  951.  
  952. typedef CRTblDesc far *pCRTblDesc;
  953.  
  954.  
  955. //============================================================================
  956. //                      Batch 
  957. //============================================================================
  958.  
  959.  
  960. typedef struct                            // Batch Table definition struct
  961.    {
  962.       hDBIDb         hDb;                       // Database
  963.       DBIPATH        szTblName;                 // Table name
  964.       DBINAME        szTblType;                 // Optional Driver type
  965.       DBINAME        szUserName;                // Optional User name
  966.       DBINAME        szPassword;                // Optional Pass word
  967.    } BATTblDesc;
  968.  
  969. typedef BATTblDesc far *pBATTblDesc;
  970.  
  971. typedef enum                   // Batch mode for DBIBatchMove
  972.    {
  973.       batAPPEND =       0,
  974.       batUPDATE =       1,
  975.       batAPPENDUPDATE = 2,
  976.       batSUBTRACT =     3,
  977.       batCOPY     =     4
  978.    } eBATMode;
  979.  
  980. typedef enum                              // Sort Order
  981.    {
  982.       sortASCEND     = 0,                    // ascending (default)
  983.       sortDESCEND    = 1,                    // descending
  984.    } SORTOrder;
  985.  
  986. typedef SORTOrder far *pSORTOrder;
  987.  
  988. typedef INT16 (DBIFN  * pfSORTCompFn)     // pntr to client compare fn
  989.    (
  990.       pVOID          pLdObj,                 // Language driver, if needed
  991.       pVOID          pValue1,                // first value
  992.       pVOID          pValue2,                // second value
  993.       INT16          iLen                    // Length, if needed
  994.    );
  995.    // Returns: -1 if (Value 1 < Value 2), 
  996.    //           0 if (Value 1 == Value 2),
  997.    //          +1 if (Value 1 > Value 2)
  998.  
  999.  
  1000. //===========================================================================
  1001. //                      Types/Structs for Capabilities 
  1002. //===========================================================================
  1003.  
  1004. typedef enum                           // Driver Category
  1005.    {
  1006.       drvFILE           = 1,              // File based (Paradox, xBASE)
  1007.       drvOTHERSERVER    = 2,              // Other kind of server (IMS ?)
  1008.       drvSQLBASEDSERVER = 3               // SQL Based Server
  1009.    } DRVCat; 
  1010.  
  1011. typedef enum                           // Config info & Optional Parameters
  1012.    {
  1013.       opDBCREATE        = 3,
  1014.       opDBOPEN          = 4,
  1015.       opTBLCREATE       = 5,
  1016.       opTBLOPEN         = 6
  1017.    } OPType;
  1018.  
  1019. typedef struct                         // Driver Description/Capabilities
  1020.    {
  1021.       DBINAME        szType;                 // Symbolic name to identify
  1022.       DBINAME        szText;                 // Descriptive text
  1023.       DRVCat         edrvCat;                // Driver category
  1024.       BOOL16         bTrueDb;                // Supports True Db concept
  1025.       DBINAME        szDbType;               // Db Type to be used
  1026.       BOOL16         bMultiUser;             // Supports Multi-user access
  1027.       BOOL16         bReadWrite;             // Read Write or Read-only
  1028.       BOOL16         bTrans;                 // Supports Transactions 
  1029.       BOOL16         bPassThruSQL;           // Supports Pass-thru SQL
  1030.       BOOL16         bLogIn;                 // Requires explicit login
  1031.       BOOL16         bCreateDb;              // Can reate a Database
  1032.       BOOL16         bDeleteDb;              // Can drop database
  1033.       BOOL16         bCreateTable;           // Can create a Table
  1034.       BOOL16         bDeleteTable;           // Can delete a Table 
  1035.       BOOL16         bMultiplePWs;           // Multiple passwords
  1036.       UINT16         iDriverVersion;         // Driver version 1..n
  1037.       BOOL16         bSQLRowid;              // Supports SQL rowid
  1038.       UINT16         iUnUsed[15];
  1039.    } DRVType;
  1040. typedef DRVType far *pDRVType;
  1041.  
  1042.  
  1043. typedef struct                            // Table Capabilities
  1044.    {
  1045.       UINT16         iId;                    // Id of Table Type
  1046.       DBINAME        szName;                 // Symbolic name; eg "dBASE"
  1047.       DBINAME        szText;                 // Descriptive text
  1048.       DBINAME        szFormat;               // Format; eg "HEAP"
  1049.       BOOL16         bReadWrite;             // User can Read/Write
  1050.       BOOL16         bCreate;                // Can create new tables
  1051.       BOOL16         bRestructure;           // Can restructure this table
  1052.       BOOL16         bValChecks;             // Val Checks can be specified
  1053.       BOOL16         bSecurity;              // Can be protected
  1054.       BOOL16         bRefIntegrity;          // Can participate in ref integrity
  1055.       BOOL16         bPrimaryKey;            // Supports primary key concept
  1056.       BOOL16         bIndexing;              // Can have other indexes
  1057.       UINT16         iFldTypes;              // Number of Phy Field types supported
  1058.       UINT16         iMaxRecSize;            // Max record size
  1059.       UINT16         iMaxFldsInTable;        // Max fields in a table
  1060.       UINT16         iMaxFldNameLen;         // Maximum field name length
  1061.       UINT16         iTblLevel;              // Driver dependent table level (version)
  1062.       UINT16         iUnUsed[16];
  1063.     } TBLType;
  1064. typedef TBLType far *pTBLType;
  1065.  
  1066.  
  1067. typedef struct 
  1068.    {
  1069.       UINT16         iId;                    // Id of Index Type
  1070.       DBINAME        szName;                 // Symbolic name
  1071.       DBINAME        szText;                 // Descriptive text
  1072.       DBINAME        szFormat;               // Optional format(BTREE, HASH etc)
  1073.       BOOL16         bComposite;             // Supports composite keys 
  1074.       BOOL16         bPrimary;               // True, if primary index
  1075.       BOOL16         bUnique;                // True, No duplicates supported
  1076.       BOOL16         bKeyDescending;         // If whole key can be descending
  1077.       BOOL16         bFldDescending;         // Field level descending
  1078.       BOOL16         bMaintained;            // Supports maintained option
  1079.       BOOL16         bSubset;                // Supports Subset expression
  1080.       BOOL16         bKeyExpr;               // If Key can be expres
  1081.       BOOL16         bCaseInsensitive;       // Supports Caseinsensitive indexes 
  1082.       UINT16         iUnUsed[16];
  1083.    } IDXType;
  1084. typedef IDXType far *pIDXType;
  1085.  
  1086. typedef struct
  1087.    {
  1088.       UINT16         iId;                    // Id of Field Type
  1089.       DBINAME        szName;                 // Symbolic name; eg "ALPHA"
  1090.       DBINAME        szText;                 // Descriptive text
  1091.       UINT16         iPhyType;               // Physical/Native type
  1092.       UINT16         iXltType;               // Default xlated type
  1093.       UINT16         iXltSubType;            // Default xlated sub type
  1094.       UINT16         iMaxUnits1;             // Max units allowed (1)
  1095.       UINT16         iMaxUnits2;             // Max units allowed (2)
  1096.       UINT16         iPhySize;               // Physical size in bytes (per unit)
  1097.       BOOL16         bRequired;              // Supports 'required' option
  1098.       BOOL16         bDefaultVal;            // Supports user specified 'default'
  1099.       BOOL16         bMinVal;                // Supports MIN Val constraint
  1100.       BOOL16         bMaxVal;                // Supports MAX Val constraint
  1101.       BOOL16         bRefIntegrity;          // Can participate in ref integrity
  1102.       BOOL16         bOtherChecks;           // Supports other kinds of checks
  1103.       BOOL16         bKeyed;                 // The field type can be keyed
  1104.       BOOL16         bMultiplePerTable;      // Table can have more than 1 of this type
  1105.       UINT16         iMinUnits1;             // Min units required (1)
  1106.       UINT16         iMinUnits2;             // Min units required (2)
  1107.       BOOL16         bCreateable;            // Type can be created
  1108.       UINT16         iUnUsed[16];
  1109.     } FLDType;
  1110. typedef FLDType far *pFLDType;
  1111.  
  1112.  
  1113. typedef enum                           // PROP Validity
  1114.    {
  1115.       epropINVALID     = 0,            // Property is INVALID (not supported)
  1116.       epropCANGET      = 1,            // You can GET value of the property
  1117.       epropCANSET      = 2             // You can GET and SET value of the property
  1118.    } PROPValid;
  1119.  
  1120.  
  1121. //===========================================================================
  1122. //                               Call Backs
  1123. //===========================================================================
  1124.  
  1125.  
  1126. typedef enum                              // Call back type
  1127.    {
  1128.        cbGENERAL      = 0,                    // General purpose
  1129.        cbRESERVED1    = 1,                    // 
  1130.        cbRESERVED2    = 2,                    // 
  1131.        cbINPUTREQ     = 3,                    // Input requested
  1132.        cbRESERVED4    = 4,                    // 
  1133.        cbRESERVED5    = 5,                    // 
  1134.        cbBATCHRESULT  = 6,                    // Batch processing rslts
  1135.        cbRESERVED7    = 7,                    // 
  1136.        cbRESTRUCTURE  = 8,                    // Restructure
  1137.        cbRESERVED9    = 9,                    // 
  1138.        cbRESERVED10   = 10,                   // 
  1139.        cbRESERVED11   = 11,                   // 
  1140.        cbRESERVED12   = 12,                   // 
  1141.        cbRESERVED13   = 13,                   // 
  1142.        cbRESERVED14   = 14,                   // 
  1143.        cbRESERVED15   = 15,                   // 
  1144.        cbRESERVED16   = 16,                   // 
  1145.        cbRESERVED17   = 17,                   // 
  1146.        cbTABLECHANGED = 18,                   // Table changed notification
  1147.        cbRESERVED19   = 19,                   // 
  1148.        cbRESERVED20   = 20,                   // 
  1149.        cbRESERVED21   = 21,                   // 
  1150.        cbRESERVED22   = 22,                   // 
  1151.        cbGENPROGRESS  = 23,                   // Generic Progress report.
  1152.        cbDBASELOGIN   = 24,                   // dBASE Login
  1153.        cbNBROFCBS     = 25                    // Number of cbs
  1154.    } CBType;
  1155. typedef CBType far *pCBType;
  1156.  
  1157.  
  1158. typedef enum                              // Call-back return type
  1159.    {
  1160.       cbrUSEDEF        = 0,                  // Take default action
  1161.       cbrCONTINUE      = 1,                  // Continue
  1162.       cbrABORT         = 2,                  // Abort the operation
  1163.       cbrCHKINPUT      = 3,                  // Input given
  1164.       cbrYES           = 4,                  // Take requested action
  1165.       cbrNO            = 5,                  // Do not take requested action
  1166.       cbrPARTIALASSIST = 6                   // Assist in completing the job
  1167.    } CBRType;
  1168. typedef CBRType far *pCBRType;
  1169.  
  1170. typedef CBRType (DBIFN  * pfDBICallBack)  // Call-back funtion pntr type
  1171.    (
  1172.       CBType         ecbType,                // Callback type
  1173.       UINT32         iClientData,            // Client callback data
  1174.       pVOID          pCbInfo                 // Call back info/Client Input
  1175.    );
  1176.  
  1177. typedef pfDBICallBack far *ppfDBICallBack;
  1178.  
  1179. // Progress callback structure
  1180. typedef struct
  1181.    {
  1182.       INT16         iPercentDone;          // Percentage done 
  1183.       DBIMSG        szMsg;                 // Message to display
  1184.    } CBPROGRESSDesc;
  1185.  
  1186. typedef  CBPROGRESSDesc far * pCBPROGRESSDesc;
  1187.  
  1188.  
  1189. typedef enum        // type of restructure object (restructure callback)
  1190.    {
  1191.       restrNONE        = 0,
  1192.       restrNEWFLD      = 1,
  1193.       restrOLDFLD      = 2,
  1194.       restrNEWINDEX    = 3,
  1195.       restrOLDINDEX    = 4,
  1196.       restrNEWVCHK     = 5,
  1197.       restrOLDVCHK     = 6,   
  1198.       restrNEWRINT     = 7,
  1199.       restrOLDRINT     = 8,
  1200.       restrNEWSEC      = 9,
  1201.       restrOLDSEC      = 10,
  1202.       restrNEWTABLE    = 11
  1203.    } RESTErrObjType;
  1204.  
  1205. #if !defined(MIDL)
  1206. typedef struct       // restructure callback info
  1207.    {
  1208.       DBIResult      iErrCode;
  1209.       UINT16         iTblNum;
  1210.       UINT16         iObjNum;       
  1211.       // for old objects iObjNum is the sequence or field number,
  1212.       // for new objects it is the order in CRTblDesc
  1213.       RESTErrObjType   eRestrObjType;
  1214.       union 
  1215.          {
  1216.             FLDDesc     fldDesc;
  1217.             IDXDesc     idxDesc;
  1218.             VCHKDesc    vchkDesc;
  1219.             RINTDesc    rintDesc;
  1220.             SECDesc     secDesc;
  1221.          } uObjDesc;
  1222.    } RESTCbDesc;
  1223.  
  1224. #endif // !defined(MIDL)
  1225.  
  1226. typedef struct {     // Entries for input requested callback
  1227.       DBINAME        szKeyWord;       // Keyword to display
  1228.       DBIMSG         szHelp;          // Help String
  1229.    } CBEntry;
  1230.  
  1231. #define  MAXCBENTRIES    4
  1232.  
  1233. typedef enum         // Id for input requested callback
  1234. {
  1235.     cbiMDXMISSING = 1,                  // MDX file missing request
  1236.     cbiPDXLOOKUP  = 2,                  // Lookup table missing
  1237.     cbiPDXBLOB    = 3,                  // Blob file missing
  1238.     cbiDBTMISSING = 4                   // DBT file missing request
  1239. }   CBInputId;                          // id's for input requests
  1240.  
  1241. typedef struct {     // Input requested callback structure
  1242.       CBInputId      eCbInputId;             // Id for this input request
  1243.       INT16          iCount;                 // Number of entries
  1244.       INT16          iSelection;             // Selection 1..n  (In/Out)
  1245.       BOOL16         bSave;                  // Save this option  (In/Out)
  1246.       DBIMSG         szMsg;                  // Message to display
  1247.       CBEntry        acbEntry[MAXCBENTRIES]; // Entries
  1248.    } CBInputDesc;
  1249.  
  1250. typedef struct       // dBASE login callback structure
  1251.    {
  1252.       DBINAME  szUserName;            // Login name of user
  1253.       DBINAME  szGroupName;           // Group to log in to
  1254.       DBINAME  szUserPassword;        // User password
  1255.    } CBLoginDesc;
  1256.  
  1257. typedef  CBLoginDesc far * pCBLoginDesc;
  1258.  
  1259.  
  1260. //============================================================================
  1261. //                         Basic Query Types
  1262. //============================================================================
  1263.  
  1264. typedef enum DBIQryLang
  1265. {
  1266.    qrylangUNKNOWN = 0,  // UNKNOWN (Error)
  1267.    qrylangQBE = 1,      // QBE
  1268.    qrylangSQL = 2       // SQL
  1269. } DBIQryLang;
  1270.  
  1271. //============================================================================
  1272. //                         Statement parameter information
  1273. //============================================================================
  1274.  
  1275. typedef enum
  1276. {
  1277.    indTRUNC = -2,         // Value has been truncated
  1278.    indNULL  = -1,         // Value is NULL
  1279.    indVALUE = 1,          // 
  1280. } eINDValues;
  1281.  
  1282. #define INDLEN             sizeof (INT16)
  1283.  
  1284. typedef enum STMTParamType
  1285. {
  1286.    paramUNKNOWN    = 0, // UNKNOWN (Error)
  1287.    paramIN         = 1, // Input parameter
  1288.    paramOUT        = 2, // Output parameter
  1289.    paramINOUT      = 3, // Input/Output parameter
  1290.    paramRET        = 4  // Procedure (or function) return
  1291. } STMTParamType;
  1292.  
  1293. typedef enum STMTParamFormat
  1294. {
  1295.    paramfmtUNKNOWN = 0, // UNKNOWN (Error)
  1296.    paramfmtNUMBER  = 1, // Numbered parameter markers of the form ? or :n
  1297.    paramfmtNAME    = 2  // Named parameters markers of the form :name
  1298. } STMTParamFormat;
  1299.  
  1300.  
  1301. //============================================================================
  1302. //                         Properties For DbiQPrepareExt
  1303. //============================================================================
  1304.  
  1305. #define qprepNONE       0     // like DbiQPrepare
  1306. #define qprepFORUPDATE  0x1   // do extra work, anticipating UPDATE WHERE CURRENT
  1307.  
  1308.  
  1309. //============================================================================
  1310. //                      Date, Time, Number Formats
  1311. //============================================================================
  1312.  
  1313.  
  1314. typedef struct                         // Date Format
  1315.    { 
  1316.       CHAR        cDecimalSeparator;         // Default "."
  1317.       CHAR        cThousandSeparator;        // Default ","
  1318.       INT8        iDecimalDigits;            // Default 2
  1319.       INT8        bLeadingZero;              // Default TRUE.
  1320.    } FMTNumber;
  1321. typedef FMTNumber far *pFMTNumber;
  1322.  
  1323. typedef struct
  1324.    {
  1325.       CHAR        szDateSeparator[4];        // Default "/"
  1326.       INT8        iDateMode;                 // 0 = MDY (Def), 1 = DMY, 2 = YMD
  1327.       INT8        bFourDigitYear;            // Write Year as 4 digits (FALSE)
  1328.       INT8        bYearBiased;               // On input add 1900 to year (TRUE)
  1329.       INT8        bMonthLeadingZero;         // Month with Leading Zero (TRUE)
  1330.       INT8        bDayLeadingZero;           // Day with Leading Zero (TRUE)
  1331.    } FMTDate;
  1332. typedef FMTDate far *pFMTDate;
  1333.  
  1334. typedef struct
  1335.    {
  1336.      CHAR         cTimeSeparator;            // Default ":" 
  1337.      INT8         bTwelveHour;               // Represent as 12 Hour time (FALSE)
  1338.      CHAR         szAmString[6];             // Default Null (Only for 12 Hr)
  1339.      CHAR         szPmString[6];             // Default Null (Only for 12 Hr)
  1340.      INT8         bSeconds;                  // Show Seconds (TRUE)
  1341.      INT8         bMilSeconds;               // Show Milli Seconds (FALSE)
  1342.    } FMTTime;
  1343. typedef FMTTime far *pFMTTime;
  1344.  
  1345.  
  1346. typedef struct
  1347. {
  1348.     BYTE    iPrecision;          // 1..64 considered valid
  1349.     BYTE    iSignSpecialPlaces;  // sign:1, special:1, places:6
  1350.     BYTE    iFraction [32];      // bcd nibbles, 00..99 per byte, high nibble 1st
  1351. } FMTBcd;
  1352.  
  1353. typedef FMTBcd far * pFMTBcd;
  1354.  
  1355.  
  1356. //============================================================================
  1357. //                              Error Info
  1358. //============================================================================
  1359.  
  1360. typedef struct {                       // Error info   
  1361.       DBIResult      iError;                 // Last error code returned
  1362.       DBIMSG         szErrCode;              // Error Code
  1363.       DBIMSG         szContext1;             // Context dependent info
  1364.       DBIMSG         szContext2;             // More context
  1365.       DBIMSG         szContext3;             // Even more context
  1366.       DBIMSG         szContext4;             // Yet some more context
  1367.     } DBIErrInfo;
  1368.  
  1369. typedef DBIErrInfo far *pDBIErrInfo;
  1370.  
  1371. // Error contexts (To be used with DbiGetErrorContext)
  1372.  
  1373. #define    ecTOKEN         1              // Token (For QBE)
  1374. #define    ecTABLENAME     3              // Table name
  1375. #define    ecFIELDNAME     4              // Field Name 
  1376. #define    ecIMAGEROW      5              // Image Row (For QBE)
  1377. #define    ecUSERNAME      6              // eg, In lock conflicts, user involved
  1378. #define    ecFILENAME      7              // File Name
  1379. #define    ecINDEXNAME     8              // Index Name
  1380. #define    ecDIRNAME       9              // Directory Name
  1381. #define    ecKEYNAME       10             // Key Name 
  1382. #define    ecALIAS         11             // Alias
  1383. #define    ecDRIVENAME     12             // Drive name ('c:')
  1384. #define    ecNATIVECODE    13             // Native error code
  1385. #define    ecNATIVEMSG     14             // Native error message
  1386. #define    ecLINENUMBER    15             // Line Number
  1387. #define    ecCAPABILITY    16             // Capability
  1388. #define    ecINTERNALLIMIT 17             // Internal limit
  1389.  
  1390. //============================================================================
  1391. //                  Schema info structures       
  1392. //============================================================================
  1393. //                    Database descriptor
  1394. //============================================================================
  1395.  
  1396.  
  1397. // DbiOpenDbList 
  1398. typedef struct                               // A given Database Description
  1399.    {
  1400.       DBINAME        szName;                 // Logical name (Or alias)
  1401.       DBINAME        szText;                 // Descriptive text
  1402.       DBIPATH        szPhyName;              // Physical name/path
  1403.       DBINAME        szDbType;               // Database type
  1404.    } DBDesc;
  1405. typedef DBDesc far *pDBDesc;
  1406.  
  1407.  
  1408. //============================================================================
  1409. //                    User info descriptor
  1410. //============================================================================
  1411.  
  1412.  
  1413. //DbiOpenUserList()
  1414. typedef struct                               // User description 
  1415.    {
  1416.       DBIUSERNAME    szUserName; 
  1417.       UINT16         iNetSession;            // Net level session number
  1418.       UINT16         iProductClass;          // Product class of user
  1419.       CHAR           szSerialNum[22];        // Serial number
  1420.    } USERDesc;
  1421. typedef USERDesc far *pUSERDesc;
  1422.  
  1423. //============================================================================
  1424. //                    Table descriptor
  1425. //============================================================================
  1426.  
  1427.  
  1428. // DbiOpenTableList()
  1429. typedef struct                            // Table description (Base)
  1430.    {
  1431.       DBITBLNAME     szName;                 // Table name(No extension or Dir)
  1432.       DBITBLNAME     szFileName;             // File name 
  1433.       DBIEXT         szExt;                  // File extension
  1434.       DBINAME        szType;                 // Driver type
  1435.       DBIDATE        dtDate;                 // Date on the table
  1436.       TIME           tmTime;                 // Time on the table
  1437.       UINT32         iSize;                  // Size in bytes
  1438.       BOOL16         bView;                  // If this a view
  1439.    } TBLBaseDesc;
  1440. typedef TBLBaseDesc far *pTBLBaseDesc;
  1441.  
  1442. typedef struct                            // Table description (Extended part)
  1443.    {
  1444.       DBINAME        szStruct;               // Physical structure
  1445.       UINT16         iRestrVersion;          // Version #
  1446.       UINT16         iRecSize;               // Physical record size
  1447.       UINT16         iFields;                // Number of fields
  1448.       UINT16         iIndexes;               // Number Indexes   
  1449.       UINT16         iValChecks;             // Number of field validity checks
  1450.       UINT16         iRintChecks;            // Number of ref. integrity checks
  1451.       UINT32         iRecords;               // Number of records in table
  1452.       BOOL16         bProtected;             // If the table is prot
  1453.       BOOL16         bValidInfo;             // Info available for this table
  1454.                                              // FALSE, if all or part of the
  1455.                                              // extended data not available.
  1456.    } TBLExtDesc;
  1457. typedef TBLExtDesc far *pTBLExtDesc;
  1458.  
  1459. typedef struct                            // Table description (Base + Ext)
  1460.    {
  1461.       TBLBaseDesc    tblBase;                // Base      description
  1462.       TBLExtDesc     tblExt;                 // Extended  description
  1463.    } TBLFullDesc;
  1464. typedef TBLFullDesc far *pTBLFullDesc;
  1465.  
  1466. //============================================================================
  1467. //                    File descriptor
  1468. //============================================================================
  1469.  
  1470.  
  1471. // DbiOpenFileList()
  1472. typedef struct                            // File description
  1473.    {
  1474.       DBIPATH        szFileName;             // File name (No Dir or ext)
  1475.       DBIEXT         szExt;                  // Extension
  1476.       BOOL16         bDir;                   // True, if directory
  1477.       UINT32         iSize;                  // File size in bytes
  1478.       DBIDATE        dtDate;                 // Date on the file
  1479.       TIME           tmTime;                 // Time on the file
  1480.    } FILEDesc;
  1481. typedef FILEDesc far *pFILEDesc;
  1482.  
  1483. //======================================================================
  1484. //            Stored Procedure and Stored Procedure Param descriptor
  1485. //======================================================================
  1486.  
  1487. typedef struct {
  1488.       DBISPNAME      szName;
  1489.       DBIDATE        dtDate;
  1490.       TIME           tmTime;
  1491.    } SPDesc;
  1492. typedef SPDesc far *pSPDesc; 
  1493.  
  1494. typedef struct {
  1495.       UINT16         uParamNum;
  1496.       DBINAME        szName;
  1497.       STMTParamType  eParamType;
  1498.       UINT16         uFldType;
  1499.       UINT16         uSubType;
  1500.       INT16          iUnits1;
  1501.       INT16          iUnits2;
  1502.       UINT16         uOffset;
  1503.       UINT16         uLen;
  1504.       UINT16         uNullOffset;
  1505.    } SPParamDesc;
  1506. typedef SPParamDesc far *pSPParamDesc;
  1507.  
  1508. //============================================================================
  1509. //                   Configuration Info Descriptor
  1510. //============================================================================
  1511.  
  1512. typedef enum
  1513.    {
  1514.      cfgPersistent  = 0,   // Persistent only
  1515.      cfgSession     = 1,   // Session relative only
  1516.      cfgAll         = 2    // All (union)
  1517.    } CFGMode;
  1518.  
  1519.  
  1520. // DbiOpenCfgInfoList()
  1521. typedef struct                            // Config description
  1522.    {
  1523.       DBINAME        szNodeName;                // Node name 
  1524.       CHAR           szDescription[DBIMAXSCFLDLEN]; // Node description
  1525.       UINT16         iDataType;                 // Value type
  1526.       CHAR           szValue[DBIMAXSCFLDLEN];   // Value
  1527.       BOOL16         bHasSubnodes;              // True, if not leaf node
  1528.    } CFGDesc;                                     
  1529. typedef CFGDesc far *pCFGDesc;
  1530.  
  1531.  
  1532. //============================================================================
  1533. //                    Family descriptor
  1534. //============================================================================
  1535.  
  1536.  
  1537. typedef enum                              // Family member types
  1538.    {
  1539.       fmlUNKNOWN     = 0,
  1540.       fmlTABLE       = 1,
  1541.       fmlINDEX       = 2,
  1542.       fmlFORM        = 3,
  1543.       fmlREPORT      = 4,
  1544.       fmlVALCHECK    = 5,
  1545.       fmlSECINDEX    = 6,
  1546.       fmlSECINDEX2   = 7,
  1547.       fmlBLOBFILE    = 8
  1548.    } FMLType;
  1549. typedef FMLType far *pFMLType;
  1550.  
  1551. // DbiOpenFamilyList()
  1552. typedef struct {                          // Family record structure
  1553.       DBINAME        szName;                 // Member name (documentary)
  1554.       UINT16         iId;                    // Id (if applicable)
  1555.       FMLType        eType;                  // Member type
  1556.       DBIPATH        szFileName;             // File name of member
  1557.    } FMLDesc;
  1558. typedef FMLDesc far *pFMLDesc;
  1559.  
  1560.  
  1561. //============================================================================
  1562. //                    Language driver descriptor
  1563. //============================================================================
  1564.  
  1565.  
  1566. #define DBIOEM_CP                    1      // (dos)
  1567. #define DBIANSI_CP                   2      // (win)
  1568. #define DBIOS2_CP                    3
  1569. /* UNIX etc. */
  1570. #define DBISUNOS_CP                  4
  1571. #define DBIVMS_CP                    5
  1572. #define DBIHPUX_CP                   6
  1573. #define DBIULTRIX_CP                 7
  1574. #define DBIAIX_CP                    8
  1575. #define DBIAUX_CP                    9
  1576. #define DBIXENIX_CP                 10
  1577. #define DBIMAC_CP                   11
  1578. #define DBINEXT_CP                  12
  1579.  
  1580. // DbiOpenLdList()
  1581. typedef struct                         // Lang Driver description
  1582.    {
  1583.       DBINAME        szName;               // Driver symbolic name
  1584.       DBINAME        szDesc;               // Description
  1585.       UINT16         iCodePage;
  1586.       UINT16         PrimaryCpPlatform;
  1587.       UINT16         AlternateCpPlatform;
  1588.    } LDDesc;
  1589. typedef LDDesc far *pLDDesc;
  1590.  
  1591. //============================================================================
  1592. //                    Lock descriptor
  1593. //============================================================================
  1594.  
  1595. // Lock types in LOCKDesc:
  1596.  
  1597. #define lckRECLOCK         0                    // Normal Record lock (Write)
  1598. #define lckRRECLOCK        1                    // Special Pdox Record lock (Read)
  1599. #define lckGROUPLOCK       2                    // Pdox Group lock
  1600. #define lckIMGAREA         3                    // Pdox Image area
  1601. #define lckTABLEREG        4                    // Table registration/Open (No lock)
  1602. #define lckTABLEREAD       5                    // Table Read lock
  1603. #define lckTABLEWRITE      6                    // Table Write lock
  1604. #define lckTABLEEXCL       7                    // Table Exclusive lock
  1605. #define lckUNKNOWN         9                    // Unknown lock
  1606.  
  1607.  
  1608. // DbiOpenLockList()
  1609. typedef struct                               // Lock Description 
  1610.    {
  1611.       UINT16         iType;                     // Lock type (0 for rec lock)            
  1612.       DBIUSERNAME    szUserName;                // Lock owner
  1613.       UINT16         iNetSession;               // Net level Session number
  1614.       UINT16         iSession;                  // Idapi session#, if our lock
  1615.       UINT32         iRecNum;                   // If a record lock
  1616.       UINT16         iInfo;                     // Info for table locks
  1617.    } LOCKDesc;
  1618. typedef LOCKDesc far *pLOCKDesc;
  1619.  
  1620. //============================================================================
  1621. //                    Filter description
  1622. //============================================================================
  1623.  
  1624. typedef enum {
  1625.  
  1626.       // Relational operators.
  1627.  
  1628.       canNOTDEFINED        = 0,        //                                  (*)
  1629.       canISBLANK,                      // CANUnary;  is operand blank.     (*)
  1630.       canNOTBLANK,                     // CANUnary;  is operand not blank. (*)
  1631.  
  1632.       canEQ,                           // CANBinary, CANCompare; equal.                (*)
  1633.       canNE,                           // CANBinary; NOT equal.            (*)
  1634.       canGT,                           // CANBinary; greater than.         (*)
  1635.       canLT,                           // CANBinary; less than.            (*)
  1636.       canGE,                           // CANBinary; greater or equal.     (*)
  1637.       canLE,                           // CANBinary; less or equal.        (*)
  1638.  
  1639.       // Logical operators.
  1640.  
  1641.       canNOT,                          // CANUnary; NOT                    (*)
  1642.       canAND,                          // CANBinary; AND                   (*)
  1643.       canOR,                           // CANBinary; OR                    (*)
  1644.  
  1645.       // Operators identifing leaf operands.
  1646.  
  1647.       canTUPLE,                        // CANUnary; Entire record is operand.
  1648.       canFIELD,                        // CANUnary; operand is field       (*)
  1649.       canCONST,                        // CANUnary; operand is constant    (*)
  1650.  
  1651.       // Arithmetic operators.
  1652.  
  1653.       canMINUS,                        // CANUnary;  minus.
  1654.       canADD,                          // CANBinary; addition.
  1655.       canSUB,                          // CANBinary; subtraction.
  1656.       canMUL,                          // CANBinary; multiplication.
  1657.       canDIV,                          // CANBinary; division.
  1658.       canMOD,                          // CANBinary; modulo division.
  1659.       canREM,                          // CANBinary; remainder of division.
  1660.  
  1661.       // Aggregate type operators.
  1662.  
  1663.       canSUM,                          // CANBinary, accumulate sum of.
  1664.       canCOUNT,                        // CANBinary, accumulate count of.
  1665.       canMIN,                          // CANBinary, find minimum of.
  1666.       canMAX,                          // CANBinary, find maximum of.
  1667.       canAVG,                          // CANBinary, find average of.
  1668.  
  1669.       // Miscellaneous operators.
  1670.  
  1671.       canCONT,                         // CANBinary; provides a link between two
  1672.                                        // expression subtrees of a tree.
  1673.       canUDF,                          // CANBinary; invokes a User defined fn
  1674.  
  1675.       canCONTINUE,                     // CANUnary; Stops evaluating records
  1676.                                        // when operand evaluates to false (forward sequential access only)
  1677.  
  1678.       canLIKE                          // CANCompare, extended binary compare       (*)
  1679.  
  1680.    } CANOp;
  1681.  
  1682. typedef CANOp far *pCANOp;
  1683.  
  1684. typedef enum {                      // Node Class
  1685.  
  1686.       nodeNULL          = 0,           // Null node                  (*)
  1687.       nodeUNARY,                       // Node is a unary            (*)
  1688.       nodeBINARY,                      // Node is a binary           (*)
  1689.       nodeCOMPARE,                     // Node is a compare          (*)
  1690.       nodeFIELD,                       // Node is a field            (*)
  1691.       nodeCONST,                       // Node is a constant         (*)
  1692.       nodeTUPLE,                       // Node is a record
  1693.       nodeCONTINUE,                    // Node is a continue node    (*)
  1694.       nodeUDF                          // Node is a UDF node
  1695.    } NODEClass;
  1696.  
  1697. // NODE definitions including misc data structures
  1698. //-------------------------------------------------
  1699.  
  1700. typedef struct {                    // Header part common to all     (*)
  1701.       NODEClass      nodeClass;
  1702.       CANOp          canOp;
  1703.    } CANHdr;
  1704. typedef CANHdr far *pCANHdr;
  1705.  
  1706. typedef struct {                    // Unary Node                    (*)
  1707.       NODEClass      nodeClass;
  1708.       CANOp          canOp;
  1709.       UINT16         iOperand1;        // Byte offset of Operand node
  1710.    } CANUnary;
  1711. typedef CANUnary far * pCANUnary;
  1712.  
  1713. typedef struct {                    // Binary Node                   (*)
  1714.       NODEClass      nodeClass;
  1715.       CANOp          canOp;
  1716.       UINT16         iOperand1;        // Byte offset of Op1
  1717.       UINT16         iOperand2;        // Byte offset of Op2
  1718.    } CANBinary;
  1719. typedef CANBinary far * pCANBinary;
  1720.  
  1721. typedef struct {                    // Field
  1722.       NODEClass      nodeClass;
  1723.       CANOp          canOp;
  1724.       UINT16         iFieldNum;
  1725.       UINT16         iNameOffset;      // Name offset in Literal pool
  1726.    } CANField;
  1727. typedef CANField far * pCANField;
  1728.  
  1729. typedef struct {                    // Constant
  1730.       NODEClass      nodeClass;
  1731.       CANOp          canOp;
  1732.       UINT16         iType;            // Constant type.
  1733.       UINT16         iSize;            // Constant size. (in bytes)
  1734.       UINT16         iOffset;          // Offset in the literal pool.
  1735.    } CANConst;
  1736. typedef CANConst far * pCANConst;
  1737.  
  1738. typedef struct {                    // Tuple (record)
  1739.       NODEClass      nodeClass;
  1740.       CANOp          canOp;
  1741.       UINT16         iSize;            // Record size. (in bytes)
  1742.    } CANTuple;
  1743. typedef CANTuple far * pCANTuple;
  1744.  
  1745. typedef struct {                    // Break Node                    (*)
  1746.       NODEClass      nodeClass;
  1747.       CANOp          canOp;
  1748.       UINT16         iContOperand;     // Continue if operand is true.
  1749.                                        // else stop evaluating records.
  1750.    } CANContinue;
  1751. typedef CANContinue far * pCANContinue;
  1752.  
  1753. typedef struct {                    // Extended compare Node (text fields) (*)
  1754.       NODEClass      nodeClass;
  1755.       CANOp          canOp;               // canLIKE, canEQ 
  1756.       BOOL16         bCaseInsensitive;    // 3 val: UNKNOWN = "fastest", "native"
  1757.       UINT16         iPartialLen;         // Partial fieldlength (0 is full length)
  1758.       UINT16         iOperand1;           // Byte offset of Op1
  1759.       UINT16         iOperand2;           // Byte offset of Op2
  1760.    } CANCompare;
  1761. typedef CANCompare far * pCANCompare;
  1762.  
  1763.  
  1764. //This is the node to be used to pass User defined functions
  1765. #define iLangSQL     0              // Common SQL dialect
  1766. #define iDbaseExpr   2              // This is also the driver ID for dBASE
  1767.  
  1768. typedef struct {                    // A user defined function
  1769.       NODEClass      nodeClass;
  1770.       CANOp          canOp;
  1771.       
  1772.       UINT16         iOffSzFuncName;   // Offset in literal pool to Function Name string(0 terminated)
  1773.  
  1774.       UINT16         iOperands;        // Byte offset of Operands (concatenated using canCONT)
  1775.  
  1776.       //The fields below are hints that specific drivers can make use of
  1777.       UINT16         iDrvDialect;      // Driver Dialect ID for UDF string supplied
  1778.       UINT16         iOffSzUDF;        // Offset in literal pool to UDF string (0 terminated)
  1779.    } CANUdf;
  1780. typedef CANUdf far * pCANUdf;
  1781.  
  1782. #if !defined(MIDL)
  1783. typedef union {
  1784.       CANHdr         canHdr;
  1785.       CANUnary       canUnary;
  1786.       CANBinary      canBinary;
  1787.       CANField       canField;
  1788.       CANConst       canConst;
  1789.       CANTuple       canTuple;
  1790.       CANContinue    canContinue;
  1791.       CANCompare     canCompare;
  1792.    } CANNode;
  1793. typedef CANNode far *pCANNode;
  1794. #endif // !defined(MIDL)
  1795.  
  1796. // Linear exression tree
  1797. //----------------------
  1798.  
  1799. # define CANEXPRVERSION   2
  1800.  
  1801. typedef struct {                    // Expression Tree
  1802.       UINT16         iVer;             // Version tag of expression.
  1803.       UINT16         iTotalSize;       // Size of this structure
  1804.       UINT16         iNodes;           // Number of nodes
  1805.       UINT16         iNodeStart;       // Starting offet of Nodes in this
  1806.       UINT16         iLiteralStart;    // Starting offset of Literals in this
  1807.       // Nodes and Literals are here
  1808.    } CANExpr;
  1809. typedef CANExpr far * pCANExpr;
  1810. typedef pCANExpr far *ppCANExpr;
  1811.  
  1812.  
  1813. //pfGENFilter returns TRUE, FALSE or ABORT
  1814. #define ABORT     -2
  1815.  
  1816. #if !defined(MIDL)
  1817. typedef INT16 (DBIFN * pfGENFilter)
  1818.    (
  1819.       UINT32            ulClientData,
  1820.       pBYTE             pRecBuf,
  1821.       UINT32            iPhyRecNum
  1822.    ) ;
  1823. #endif // !defined(MIDL)
  1824.  
  1825. typedef UINT32 hDBIFilter ;
  1826. typedef hDBIFilter far *phDBIFilter ;
  1827.  
  1828.  
  1829. #if !defined(MIDL)
  1830. typedef struct
  1831.    {
  1832.       UINT16          iFilterId;    // Id for filter 
  1833.       hDBIFilter      hFilter;      // Filter handle
  1834.       UINT32          iClientData;  // Client supplied data
  1835.       UINT16          iPriority;    // 1..N with 1 being highest
  1836.       BOOL16          bCanAbort;    // TRUE : pfFilter can return ABORT
  1837.       pfGENFilter     pfFilter;     // Client filter function
  1838.       pVOID           pCanExpr;     // Supplied expression
  1839.       BOOL16          bActive ;     // TRUE : filter is active
  1840.    } FILTERInfo;
  1841. typedef FILTERInfo far *pFILTERInfo;
  1842. #endif // !defined(MIDL)
  1843.  
  1844. #ifndef NODBIQBE
  1845.  
  1846. //---------------------------------------------------------------------------
  1847. //   DBI Query related types
  1848. //---------------------------------------------------------------------------
  1849.  
  1850. #define MAXQBEEXPRSIZE  300             // size of one QBE expr
  1851.  
  1852.  
  1853. typedef struct  _DBIQryProp
  1854. {
  1855.    DBINAME    szQryName;       // Name of query
  1856.    DBIQryLang eLang;           // Language
  1857.    INT16      iQryPrice;       // Query price 1..100 (1 = cheap, 100 = expensive)
  1858.    INT16      iNumTables;      // Number of tables in join.  0 = unknown.
  1859.    BOOL16     bHasAnswer;
  1860.    BOOL16     bInsert;
  1861.    BOOL16     bDelete;
  1862.    BOOL16     bChange;
  1863. }  DBIQryProp, far *pDBIQryProp;
  1864.  
  1865.  
  1866. #define DBIQBE_ANSWERBIT    (0x1)    // Answer table bit flag
  1867. #define DBIQBE_INSERTEDBIT  (0x2)    // Inserted table bit flag
  1868. #define DBIQBE_DELETEDBIT   (0x4)    // Deleted table bit flag
  1869. #define DBIQBE_CHANGEDBIT   (0x8)    // Changed table bit flag
  1870. #define DBIQBE_ERRORINSBIT  (0x10)   // Error inserted table bit flag
  1871. #define DBIQBE_ERRORDELBIT  (0x20)   // Error deleted table bit flag
  1872. #define DBIQBE_ERRORCHGBIT  (0x40)   // Error changed table bit flag
  1873.  
  1874.  
  1875. // answer cursor properties:
  1876.  
  1877. #define bAnsHasLiveFields  0x1
  1878. #define bAnsHasFilter      0x2
  1879. #define bAnsHasFieldMap    0x4
  1880. #define bAnsHasCalcField   0x8
  1881. #define bAnsHasLiveBlob    0x10
  1882.  
  1883. // answer field properties:
  1884.  
  1885. #define bIsAnsFieldLive    0x1
  1886.  
  1887.  
  1888.  
  1889. typedef enum 
  1890. {
  1891.    dbiqryDEFAULT = 0,
  1892.    dbiqryDIRTY   = 1,
  1893.    dbiqryCLEAN   = 2,
  1894.    dbiqryRESTART = 3
  1895. } DBIQryType, far *pDBIQryType;
  1896.  
  1897.  
  1898. //---------------------------------------------------------------------------
  1899. typedef struct
  1900. {
  1901.    UINT16    stepsInQry;      // Total steps in query.
  1902.    UINT16    stepsCompleted;  // Steps completed out of total (steps may be skipped).
  1903.    UINT32    totElemInStep;   // Total elements in current step.
  1904.    UINT32    elemCompleted;   // Elements completed in current step.
  1905. } DBIQryProgress, far *pDBIQryProgress;
  1906.  
  1907.  
  1908. typedef enum
  1909. {
  1910.    qryModeNONE     = 0,       // Reserved
  1911.    qryModeLOCAL    = 1,
  1912.    qryModeSERVER   = 2,
  1913.    qryModeEITHER   = 3,
  1914.    qryModeNOWLOCAL = 4        // used only in call back, when failed on server
  1915. } QryEvalMode;
  1916.  
  1917.  
  1918. // values for client indicating live/canned preference about query execution
  1919. typedef enum
  1920. {
  1921.    wantDEFAULT     = 0,        // Default , same as wantCANNED
  1922.    wantLIVE        = 1,        // Want live data even if extra effort (no guarantee)
  1923.    wantCANNED      = 2,        // Want canned data even if extra effort (guaranteed)
  1924.    wantSPEED       = 3         // Let query manager decide, find out afterwards
  1925. } LIVENESS;
  1926.  
  1927.  
  1928. typedef struct
  1929. {
  1930.    INT16       length;        // Length in bytes of this structure
  1931.    BOOL16      blankzeroes;   // TRUE if blanks to be regarded as zeros
  1932.    FMTDate     dateFormat;    // Date format
  1933.    FMTNumber   numberFormat;  // Number format
  1934.    BOOL16      bNeedAuxTbls;  // If FALSE, don't bother with DELETED/ERRDEL, etc.
  1935.    QryEvalMode qryMode;       // qryModeSERVER, qryModeLOCAL or qryModeEITHER.
  1936.    BOOL16      perQrySqlMode;
  1937.    LIVENESS    livenessDesired;
  1938. } QueryLowProps, far *pQueryLowProps;
  1939.  
  1940. #endif  // NODBIQBE
  1941.  
  1942. #endif  // NODBITYPES
  1943.  
  1944. #ifndef NODBISYMBOLS
  1945. //=======================================================================================
  1946. //                      DBI symbols
  1947. //=======================================================================================
  1948.  
  1949. # define DBIMOD_BEGIN         (0x3F00U)
  1950.  
  1951. # define DBIMOD_QBE           (DBIMOD_BEGIN + 1)
  1952. # define DBIMOD_SQLG          (DBIMOD_BEGIN + 2)
  1953. # define DBIMOD_LEGO          (DBIMOD_BEGIN + 3)
  1954. # define DBIMOD_LOCKMNGR      (DBIMOD_BEGIN + 4)
  1955. # define DBIMOD_SQLDRIVER     (DBIMOD_BEGIN + 5)
  1956. # define DBIMOD_OS            (DBIMOD_BEGIN + 6)
  1957. # define DBIMOD_DBASEDRV      (DBIMOD_BEGIN + 7)
  1958.  
  1959. # define DBIMOD_END           (DBIMOD_BEGIN + 8)
  1960.  
  1961. //---------------------------------------------------------------------------
  1962.  
  1963. # define DBISYM_BEGIN         (DBIMOD_END + 1)
  1964.  
  1965. # define DBISYM_TOKEN         (DBISYM_BEGIN + ecTOKEN)
  1966. # define DBISYM_TABLENAME     (DBISYM_BEGIN + ecTABLENAME)
  1967. # define DBISYM_FIELDNAME     (DBISYM_BEGIN + ecFIELDNAME)
  1968. # define DBISYM_IMAGEROW      (DBISYM_BEGIN + ecIMAGEROW)
  1969. # define DBISYM_USERNAME      (DBISYM_BEGIN + ecUSERNAME)
  1970. # define DBISYM_FILENAME      (DBISYM_BEGIN + ecFILENAME)
  1971. # define DBISYM_INDEXNAME     (DBISYM_BEGIN + ecINDEXNAME)
  1972. # define DBISYM_DIRNAME       (DBISYM_BEGIN + ecDIRNAME)
  1973. # define DBISYM_KEYNAME       (DBISYM_BEGIN + ecKEYNAME)
  1974. # define DBISYM_ALIAS         (DBISYM_BEGIN + ecALIAS)
  1975. # define DBISYM_DRIVENAME     (DBISYM_BEGIN + ecDRIVENAME)
  1976. # define DBISYM_NATIVECODE    (DBISYM_BEGIN + ecNATIVECODE)
  1977. # define DBISYM_NATIVEMSG     (DBISYM_BEGIN + ecNATIVEMSG)
  1978. # define DBISYM_LINENUMBER    (DBISYM_BEGIN + ecLINENUMBER)
  1979. # define DBISYM_CAPABILITY    (DBISYM_BEGIN + ecCAPABILITY)
  1980. # define DBISYM_INTERNALLIMIT (DBISYM_BEGIN + ecINTERNALLIMIT)
  1981.  
  1982. # define DBISYM_BASEEND       (DBISYM_BEGIN + 100)
  1983.  
  1984. //-----------------------------------------------------------------------------
  1985.  
  1986. # define DBISYM_MISC          (DBISYM_BASEEND + 1)
  1987.  
  1988. # define DBISYM_WORK          (DBISYM_MISC + 1)
  1989. # define DBISYM_PRIV          (DBISYM_MISC + 2)
  1990. # define DBISYM_COPY          (DBISYM_MISC + 3)
  1991. # define DBISYM_APPEND        (DBISYM_MISC + 4)
  1992.  
  1993. # define DBISYM_END           (DBIMOD_BEGIN + 0x3FFF)
  1994.  
  1995.  
  1996.  
  1997. //=======================================================================================
  1998. //                      DBI Config symbols
  1999. //=======================================================================================
  2000.  
  2001.  
  2002.  
  2003. // Categories
  2004.  
  2005. #define szCFGSYSTEM        "SYSTEM"
  2006. #define szCFGDRIVER        "DRIVERS"
  2007. #define szCFGDATABASE      "DATABASES"
  2008.  
  2009. //--------------------------------------------------------------------------
  2010. // System Fields
  2011. //--------------------------------------------------------------------------
  2012.  
  2013. #define szCFGSYSVERSION       "VERSION"
  2014. #define szCFGSYSNETTYPE       "NET TYPE"
  2015. #define szCFGSYSNETDIR        "NET DIR"
  2016. #define szCFGSYSLOCALSHARE    "LOCAL SHARE"
  2017. #define szCFGSYSLANGDRV       "LANGDRIVER"
  2018. #define szCFGSYSLANGDRVDIR    "LANGDRVDIR"
  2019. #define szCFGSYSMINBUF        "MINBUFSIZE"
  2020. #define szCFGSYSMAXBUF        "MAXBUFSIZE"
  2021. #define szCFGSYSLOCKRETRY     "LOCKRETRY"
  2022. #define szCFGSYSFLAGS         "SYSFLAGS"
  2023. #define szCFGMAXFILEHANDLES   "MAXFILEHANDLES"
  2024. #define szCFGSQLQRYMODE       "SQLQRYMODE"
  2025. #define szCFGLOWMEMLIMIT      "LOW MEMORY USAGE LIMIT"  // Use this instead of NOLOWMEMBUF
  2026. #define szCFGSYSODBCCFGIMPORT "AUTO ODBC"
  2027. #define szCFGSYSDEFDRV        "DEFAULT DRIVER"
  2028.  
  2029.  
  2030. //--------------------------------------------------------------------------
  2031. // Driver Fields
  2032. //--------------------------------------------------------------------------
  2033.  
  2034. #define szCFGDRVVERSION       "VERSION"
  2035. #define szCFGDRVTYPE          "TYPE"
  2036. #define szCFGDRVDLL           "DLL"
  2037. #define szCFGDRVDLL32         "DLL32"
  2038. #define szCFGDRVFLAGS         "DRIVER FLAGS"
  2039. #define szCFGDRVLANGDRIVER    "LANGDRIVER"
  2040. #define szCFGDRVFILLFACTOR    "FILL FACTOR"
  2041. #define szCFGDRVBLOCKSIZE     "BLOCK SIZE"
  2042. #define szCFGDRVLOCKPROTOCOL  "LOCKPROTOCOL"
  2043. #define szCFGDRVLEVEL         "LEVEL"
  2044. #define szCFGDRVVENDINIT      "VENDOR INIT"
  2045.  
  2046. //--------------------------------------------------------------------------
  2047. // Dbase Driver fields
  2048. //--------------------------------------------------------------------------
  2049.  
  2050. #define szCFGDRVMEMOBLOCKSIZE "MEMO FILE BLOCK SIZE"
  2051. #define szCFGDRVMDXBLOCKSIZE  "MDX BLOCK SIZE"
  2052.  
  2053.  
  2054. //--------------------------------------------------------------------------
  2055. // Driver Nodes
  2056. //--------------------------------------------------------------------------
  2057.  
  2058. #define szCFGDRVINIT         "INIT"
  2059. #define szCFGDBCREATE        "DB CREATE"
  2060. #define szCFGDBOPEN          "DB OPEN"
  2061. #define szCFGTBLCREATE       "TABLE CREATE"
  2062. #define szCFGTBLOPEN         "TABLE OPEN"
  2063.  
  2064. //--------------------------------------------------------------------------
  2065. // Database Nodes
  2066. //--------------------------------------------------------------------------
  2067.  
  2068. #define szCFGDBINFO          "DB INFO"
  2069.  
  2070. //--------------------------------------------------------------------------
  2071. // Database fields
  2072. //--------------------------------------------------------------------------
  2073.  
  2074. #define szCFGDBTYPE          "TYPE"
  2075. #define szCFGDBPATH          "PATH"
  2076. #define szCFGDBDEFAULTDRIVER "DEFAULT DRIVER"
  2077.  
  2078. //--------------------------------------------------------------------------
  2079. // Others
  2080. //--------------------------------------------------------------------------
  2081.  
  2082. #define szCFGINIT            "INIT"
  2083. #define szTYPE               "TYPE"
  2084. #define szCFGDBSTANDARD      "STANDARD"
  2085. #define szCFGTRUE            "TRUE"
  2086. #define szCFGFALSE           "FALSE"
  2087. #define szOPENMODE           "OPEN MODE"
  2088. #define szREADWRITE          "READ/WRITE"
  2089. #define szREADONLY           "READ ONLY"
  2090. #define szSHAREMODE          "SHARE MODE"
  2091. #define szEXCLUSIVE          "EXCLUSIVE"
  2092. #define szSHARED             "SHARED"
  2093. #define szUSERNAME           "USER NAME"
  2094. #define szSERVERNAME         "SERVER NAME"
  2095. #define szDATABASENAME       "DATABASE NAME"
  2096. #define szSCHEMASIZE         "SCHEMA CACHE SIZE"
  2097. #define szCFGSTRICTINTEGRITY "STRICTINTEGRTY"
  2098. #define szSQLPASSMODE        "SQLPASSTHRU MODE"
  2099. #define szNOTSHARED          "NOT SHARED"
  2100. #define szSHAREDAUTOCOMMIT   "SHARED AUTOCOMMIT"
  2101. #define szSHAREDNOAUTOCOMMIT "SHARED NOAUTOCOMMIT"
  2102. #define szSCHEMATIME         "SCHEMA CACHE TIME"
  2103. #define szMAXQUERYTIME       "MAX QUERY TIME"
  2104.  
  2105.  
  2106.  
  2107. //--------------------------------------------------------------------------
  2108. // SYSTEM DATE/TIME/NUMBER FORMATS
  2109. // SYSTEM nodes:
  2110. //--------------------------------------------------------------------------
  2111. #define  szCFGFORMAT          "FORMATS"
  2112.  
  2113. //--------------------------------------------------------------------------
  2114. // Format nodes:
  2115. //--------------------------------------------------------------------------
  2116. #define  szCFGDATE           "DATE"
  2117. #define  szCFGTIME           "TIME"
  2118. #define  szCFGNUMBER         "NUMBER"
  2119.  
  2120. //--------------------------------------------------------------------------
  2121. // DATE and/or TIME fields:
  2122. //--------------------------------------------------------------------------
  2123. #define szCFGSEPARATOR        "SEPARATOR"
  2124. #define szCFGMODE             "MODE"
  2125. #define szCFGFOURDIGITYEAR    "FOURDIGITYEAR"
  2126. #define szCFGYEARBIASED       "YEARBIASED"
  2127. #define szCFGLEADINGZEROM     "LEADINGZEROM"
  2128. #define szCFGLEADINGZEROD     "LEADINGZEROD"
  2129. #define szCFGTWELVEHOUR       "TWELVEHOUR"
  2130. #define szCFGAMSTRING         "AMSTRING"
  2131. #define szCFGPMSTRING         "PMSTRING"
  2132. #define szCFGSECONDS          "SECONDS"
  2133. #define szCFGMILSECONDS       "MILSECONDS"
  2134.  
  2135. //--------------------------------------------------------------------------
  2136. // Number fields:
  2137. //--------------------------------------------------------------------------
  2138. #define szCFGDECIMALSEPARATOR    "DECIMALSEPARATOR"
  2139. #define szCFGTHOUSANDSEPARATOR   "THOUSANDSEPARATOR"
  2140. #define szCFGDECIMALDIGITS       "DECIMALDIGITS"
  2141. #define szCFGLEADINGZERON        "LEADINGZERON"
  2142.  
  2143.  
  2144.  
  2145. // String resoure id's for each string listed above
  2146.  
  2147. #define   DBICFG_BASE              0x3A00
  2148.  
  2149. //--------------------------------------------------------------------------
  2150. // Categories
  2151. //--------------------------------------------------------------------------
  2152. #define iCFGSYSTEM               (DBICFG_BASE + 1)
  2153. #define iCFGDRIVER               (DBICFG_BASE + 2)
  2154. #define iCFGDATABASE             (DBICFG_BASE + 3)
  2155.  
  2156. //--------------------------------------------------------------------------
  2157. // System Fields
  2158. //--------------------------------------------------------------------------
  2159. #define iCFGSYSVERSION           (DBICFG_BASE + 5)
  2160. #define iCFGSYSNETTYPE           (DBICFG_BASE + 6)
  2161. #define iCFGSYSNETDIR            (DBICFG_BASE + 7)
  2162. #define iCFGSYSLOCALSHARE        (DBICFG_BASE + 8)
  2163. #define iCFGSYSLANGDRV           (DBICFG_BASE + 9)
  2164. #define iCFGSYSLANGDRVDIR        (DBICFG_BASE + 10)
  2165. #define iCFGSYSMINBUF            (DBICFG_BASE + 11)
  2166. #define iCFGSYSMAXBUF            (DBICFG_BASE + 12)
  2167. #define iCFGSYSLOCKRETRY         (DBICFG_BASE + 13)
  2168. #define iCFGSYSFLAGS             (DBICFG_BASE + 14)
  2169. #define iCFGMAXFILEHANDLES       (DBICFG_BASE + 15)
  2170. #define iCFGSQLQRYMODE           (DBICFG_BASE + 16)
  2171. #define iCFGLOWMEMLIMIT          (DBICFG_BASE + 17)
  2172. #define iCFGSYSODBCCFGIMPORT     (DBICFG_BASE + 18)
  2173. #define iCFGSYSDEFDRV            (DBICFG_BASE + 19)
  2174.  
  2175. //--------------------------------------------------------------------------
  2176. // Driver Fields
  2177. //--------------------------------------------------------------------------
  2178. #define iCFGDRVVERSION           (DBICFG_BASE + 20)
  2179. #define iCFGDRVTYPE              (DBICFG_BASE + 21)
  2180. #define iCFGDRVLANGDRIVER        (DBICFG_BASE + 22)
  2181. #define iCFGDRVFILLFACTOR        (DBICFG_BASE + 23)
  2182. #define iCFGDRVBLOCKSIZE         (DBICFG_BASE + 24)
  2183. #define iCFGDRVLOCKPROTOCOL      (DBICFG_BASE + 25)
  2184. #define iCFGDRVLEVEL             (DBICFG_BASE + 26)
  2185. #define iCFGDRVFLAGS             (DBICFG_BASE + 27)
  2186.  
  2187. //--------------------------------------------------------------------------
  2188. // Dbase Driver fields      
  2189. //--------------------------------------------------------------------------
  2190. #define iCFGDRVMEMOBLOCKSIZE     (DBICFG_BASE + 30 )
  2191. #define iCFGDRVMDXBLOCKSIZE      (DBICFG_BASE + 31 )
  2192.  
  2193.  
  2194. //--------------------------------------------------------------------------
  2195. // Driver Nodes
  2196. //--------------------------------------------------------------------------
  2197. #define iCFGDRVINIT              (DBICFG_BASE + 40 )
  2198. #define iCFGDBCREATE             (DBICFG_BASE + 41 )
  2199. #define iCFGDBOPEN               (DBICFG_BASE + 42 )
  2200. #define iCFGTBLCREATE            (DBICFG_BASE + 43 )
  2201. #define iCFGTBLOPEN              (DBICFG_BASE + 44 )
  2202.  
  2203. //--------------------------------------------------------------------------
  2204. // Database Nodes
  2205. //--------------------------------------------------------------------------
  2206. #define iCFGDBINFO               (DBICFG_BASE + 50 )
  2207.  
  2208. //--------------------------------------------------------------------------
  2209. // Database fields
  2210. //--------------------------------------------------------------------------
  2211. #define iCFGDBTYPE               (DBICFG_BASE + 60)
  2212. #define iCFGDBPATH               (DBICFG_BASE + 61)
  2213. #define iCFGDBDEFAULTDRIVER      (DBICFG_BASE + 62)
  2214.  
  2215. //--------------------------------------------------------------------------
  2216. // Others
  2217. //--------------------------------------------------------------------------
  2218. #define iCFGINIT                 (DBICFG_BASE + 70)
  2219. #define iTYPE                    (DBICFG_BASE + 71)
  2220. #define iCFGDBSTANDARD           (DBICFG_BASE + 72)
  2221. #define iCFGTRUE                 (DBICFG_BASE + 73)
  2222. #define iCFGFALSE                (DBICFG_BASE + 74)
  2223. #define iOPENMODE                (DBICFG_BASE + 75)
  2224. #define iREADWRITE               (DBICFG_BASE + 76)
  2225. #define iREADONLY                (DBICFG_BASE + 77)
  2226. #define iSHAREMODE               (DBICFG_BASE + 78)
  2227. #define iEXCLUSIVE               (DBICFG_BASE + 79)
  2228. #define iSHARED                  (DBICFG_BASE + 80)
  2229. #define iUSERNAME                (DBICFG_BASE + 81)
  2230. #define iSERVERNAME              (DBICFG_BASE + 82)
  2231. #define iDATABASENAME            (DBICFG_BASE + 83)
  2232. #define iSCHEMASIZE              (DBICFG_BASE + 84)
  2233. #define iCFGSTRICTINTEGRITY      (DBICFG_BASE + 85)
  2234.  
  2235. //--------------------------------------------------------------------------
  2236. // System node:
  2237. //--------------------------------------------------------------------------
  2238. #define  iCFGFORMAT              (DBICFG_BASE + 130)
  2239.  
  2240. //--------------------------------------------------------------------------
  2241. // Format nodes:
  2242. //--------------------------------------------------------------------------
  2243. #define  iCFGDATE                (DBICFG_BASE + 131)
  2244. #define  iCFGTIME                (DBICFG_BASE + 132)
  2245. #define  iCFGNUMBER              (DBICFG_BASE + 133)
  2246.  
  2247. //--------------------------------------------------------------------------
  2248. // DATE and/or TIME fields:
  2249. //--------------------------------------------------------------------------
  2250. #define iCFGSEPARATOR            (DBICFG_BASE + 140)
  2251. #define iCFGMODE                 (DBICFG_BASE + 141)
  2252. #define iCFGFOURDIGITYEAR        (DBICFG_BASE + 142)
  2253. #define iCFGYEARBIASED           (DBICFG_BASE + 143)
  2254. #define iCFGLEADINGZEROM         (DBICFG_BASE + 144)
  2255. #define iCFGLEADINGZEROD         (DBICFG_BASE + 145)
  2256. #define iCFGTWELVEHOUR           (DBICFG_BASE + 146)
  2257. #define iCFGAMSTRING             (DBICFG_BASE + 147)
  2258. #define iCFGPMSTRING             (DBICFG_BASE + 148)
  2259. #define iCFGSECONDS              (DBICFG_BASE + 149)
  2260. #define iCFGMILSECONDS           (DBICFG_BASE + 150)
  2261.  
  2262. //--------------------------------------------------------------------------
  2263. // Number fields:
  2264. //--------------------------------------------------------------------------
  2265. #define iCFGDECIMALSEPARATOR     (DBICFG_BASE + 160)
  2266. #define iCFGTHOUSANDSEPARATOR    (DBICFG_BASE + 161)
  2267. #define iCFGDECIMALDIGITS        (DBICFG_BASE + 162)
  2268. #define iCFGLEADINGZERON         (DBICFG_BASE + 163)
  2269.  
  2270. #define iCFGDEFLANGDRV           (DBICFG_BASE + 165)
  2271. #define iCFGDBASEDEFLANGDRV      (DBICFG_BASE + 166)
  2272.  
  2273. //--------------------------------------------------------------------------
  2274. //Formats
  2275. //--------------------------------------------------------------------------
  2276. #define iCFGDEFSEPARATOR         (DBICFG_BASE + 170)
  2277. #define iCFGDEFMODE              (DBICFG_BASE + 171)
  2278. #define iCFGDEFFOURDIGITYEAR     (DBICFG_BASE + 172)
  2279. #define iCFGDEFYEARBIASED        (DBICFG_BASE + 173)
  2280. #define iCFGDEFLEADINGZEROM      (DBICFG_BASE + 174)
  2281. #define iCFGDEFLEADINGZEROD      (DBICFG_BASE + 175)
  2282. #define iCFGDEFTWELVEHOUR        (DBICFG_BASE + 176)
  2283. #define iCFGDEFAMSTRING          (DBICFG_BASE + 177)
  2284. #define iCFGDEFPMSTRING          (DBICFG_BASE + 178)
  2285. #define iCFGDEFSECONDS           (DBICFG_BASE + 179)
  2286. #define iCFGDEFMILSECONDS        (DBICFG_BASE + 180)
  2287. #define iCFGDEFDECIMALSEPARATOR  (DBICFG_BASE + 181)
  2288. #define iCFGDEFTHOUSANDSEPARATOR (DBICFG_BASE + 182)
  2289. #define iCFGDEFLEADINGZERO       (DBICFG_BASE + 183)
  2290.  
  2291.  
  2292. // Categories
  2293. extern const char far SZCFGSYSTEM[];
  2294. extern const char far SZCFGDRIVER[];
  2295. extern const char far SZCFGDATABASE[];
  2296.                                
  2297. // System Fields
  2298. extern const char far SZCFGSYSVERSION[];
  2299. extern const char far SZCFGSYSNETTYPE[];
  2300. extern const char far SZCFGSYSNETDIR[];
  2301. extern const char far SZCFGSYSLOCALSHARE[];
  2302. extern const char far SZCFGSYSLANGDRV[];
  2303. extern const char far SZCFGSYSLANGDRVDIR[];
  2304. extern const char far SZCFGSYSMINBUF[]; 
  2305. extern const char far SZCFGSYSMAXBUF[];
  2306. extern const char far SZCFGSYSLOCKRETRY[];
  2307. extern const char far SZCFGSYSFLAGS[];     
  2308. extern const char far SZCFGMAXFILEHANDLES[];
  2309. extern const char far SZCFGSQLQRYMODE[];
  2310. extern const char far SZCFGLOWMEMLIMIT[];
  2311. extern const char far SZCFGSYSODBCCFGIMPORT[];
  2312.  
  2313.                          
  2314. // Driver Fields
  2315. extern const char far SZCFGDRVVERSION[];
  2316. extern const char far SZCFGDRVTYPE[];  
  2317. extern const char far SZCFGDRVDLL[];   
  2318. extern const char far SZCFGDRVDLL32[];    
  2319. extern const char far SZCFGDRVFLAGS[];
  2320. extern const char far SZCFGDRVLANGDRIVER[];
  2321. extern const char far SZCFGDRVFILLFACTOR[];
  2322. extern const char far SZCFGDRVBLOCKSIZE[]; 
  2323. extern const char far SZCFGDRVLOCKPROTOCOL[];
  2324. extern const char far SZCFGDRVLEVEL[];      
  2325.                     
  2326. // Dbase Driver fields
  2327. extern const char far SZCFGDRVMEMOBLOCKSIZE[];
  2328. extern const char far SZCFGDRVMDXBLOCKSIZE[]; 
  2329.                      
  2330.  
  2331.  
  2332. // Driver Nodes
  2333. extern const char far SZCFGDRVINIT[];
  2334. extern const char far SZCFGDBCREATE[];
  2335. extern const char far SZCFGDBOPEN[]; 
  2336. extern const char far SZCFGTBLCREATE[];
  2337. extern const char far SZCFGTBLOPEN[]; 
  2338.                    
  2339. // Database Nodes
  2340. extern const char far SZCFGDBINFO[]; 
  2341.                  
  2342. // Database fields
  2343. extern const char far SZCFGDBTYPE[]; 
  2344. extern const char far SZCFGDBPATH[]; 
  2345. extern const char far SZCFGDBDEFAULTDRIVER[]; 
  2346.                  
  2347. // Others
  2348. extern const char far SZCFGINIT[]; 
  2349. extern const char far SZTYPE[];    
  2350. extern const char far SZCFGDBSTANDARD[];
  2351. extern const char far SZCFGTRUE[];  
  2352. extern const char far SZCFGFALSE[];    
  2353. extern const char far SZOPENMODE[]; 
  2354. extern const char far SZREADWRITE[];
  2355. extern const char far SZREADONLY[]; 
  2356. extern const char far SZSHAREMODE[];
  2357. extern const char far SZEXCLUSIVE[];
  2358. extern const char far SZSHARED[];   
  2359. extern const char far SZUSERNAME[]; 
  2360. extern const char far SZSERVERNAME[]; 
  2361. extern const char far SZDATABASENAME[];
  2362. extern const char far SZSCHEMASIZE[];  
  2363. extern const char far SZCFGSTRICTINTEGRITY[];
  2364.                     
  2365.           
  2366.  
  2367. // SYSTEM DATE/TIME/NUMBER FORMATS
  2368. // SYSTEM nodes:
  2369. extern const char far  SZCFGFORMAT[];
  2370.                  
  2371. // Format nodes:
  2372. extern const char far  SZCFGDATE[];
  2373. extern const char far  SZCFGTIME[];
  2374. extern const char far  SZCFGNUMBER[];
  2375.                  
  2376. // DATE and/or TIME fields:
  2377. extern const char far SZCFGSEPARATOR[];
  2378. extern const char far SZCFGMODE[];
  2379. extern const char far SZCFGFOURDIGITYEAR[];
  2380. extern const char far SZCFGYEARBIASED[];
  2381. extern const char far SZCFGLEADINGZEROM[]; 
  2382. extern const char far SZCFGLEADINGZEROD[]; 
  2383. extern const char far SZCFGTWELVEHOUR[]; 
  2384. extern const char far SZCFGAMSTRING[]; 
  2385. extern const char far SZCFGPMSTRING[]; 
  2386. extern const char far SZCFGSECONDS[]; 
  2387. extern const char far SZCFGMILSECONDS[]; 
  2388.                      
  2389. // Number fields:
  2390. extern const char far SZCFGDECIMALSEPARATOR[];
  2391. extern const char far SZCFGTHOUSANDSEPARATOR[];
  2392. extern const char far SZCFGDECIMALDIGITS[];  
  2393. extern const char far SZCFGLEADINGZERON[];   
  2394.  
  2395.  
  2396. extern const char far SZCFGDEFLANGDRV[]; 
  2397. extern const char far SZCFGDBASEDEFLANGDRV[];
  2398. extern const char far SZCFGDEFSEPARATOR[];   
  2399. extern const char far SZCFGDEFMODE[];       
  2400. extern const char far SZCFGDEFFOURDIGITYEAR[];
  2401. extern const char far SZCFGDEFYEARBIASED[];   
  2402. extern const char far SZCFGDEFLEADINGZEROM[]; 
  2403. extern const char far SZCFGDEFLEADINGZEROD[]; 
  2404. extern const char far SZCFGDEFTWELVEHOUR[];   
  2405. extern const char far SZCFGDEFAMSTRING[];     
  2406. extern const char far SZCFGDEFPMSTRING[];     
  2407. extern const char far SZCFGDEFSECONDS[];      
  2408. extern const char far SZCFGDEFMILSECONDS[];   
  2409. extern const char far SZCFGDEFDECIMALSEPARATOR[];
  2410. extern const char far SZCFGDEFTHOUSANDSEPARATOR[];
  2411. extern const char far SZCFGDEFLEADINGZERO[];
  2412.                    
  2413.  
  2414. #endif  // NODBISYMBOLS
  2415.  
  2416.  
  2417. #ifndef NODBIERRS
  2418. #define ErrCat(rslt)  ((UINT16)(rslt) >> 8)
  2419. #define ErrCode(rslt) ((UINT16)(rslt) & 0x00FF)
  2420.  
  2421.  
  2422. //============================================================================
  2423. //                            Error Categories
  2424. //============================================================================
  2425.  
  2426. #define ERRCAT_NONE                0   //  0   No error
  2427. #define ERRCAT_SYSTEM            0x21  //  33  System related (Fatal Error)
  2428. #define ERRCAT_NOTFOUND          0x22  //  34  Object of interest Not Found
  2429. #define ERRCAT_DATACORRUPT       0x23  //  35  Physical Data Corruption
  2430. #define ERRCAT_IO                0x24  //  36  I/O related error
  2431. #define ERRCAT_LIMIT             0x25  //  37  Resource or Limit error
  2432. #define ERRCAT_INTEGRITY         0x26  //  38  Integrity Violation
  2433. #define ERRCAT_INVALIDREQ        0x27  //  39  Invalid Request
  2434. #define ERRCAT_LOCKCONFLICT      0x28  //  40  Locking/Contention related
  2435. #define ERRCAT_SECURITY          0x29  //  41  Access Violation - Security related
  2436. #define ERRCAT_INVALIDCONTEXT    0x2A  //  42  Invalid context
  2437. #define ERRCAT_OS                0x2B  //  43  Os Error not handled by Idapi
  2438. #define ERRCAT_NETWORK           0x2C  //  44  Network related
  2439. #define ERRCAT_OPTPARAM          0x2D  //  45  Optional parameter related
  2440. #define ERRCAT_QUERY             0x2E  //  46  Query related 
  2441. #define ERRCAT_VERSION           0x2F  //  47  Version Mismatch Category
  2442. #define ERRCAT_CAPABILITY        0x30  //  48  Capability not supported
  2443. #define ERRCAT_CONFIG            0x31  //  49  System configuration error
  2444. #define ERRCAT_WARNING           0x32  //  50
  2445. #define ERRCAT_OTHER             0x33  //  51  Miscellaneous
  2446. #define ERRCAT_COMPATIBILITY     0x34  //  52  Compatibility related
  2447.  
  2448. #define ERRCAT_DRIVER            0x3E  //  62  Driver related
  2449. #define ERRCAT_RC                0x3F  //  63  Internal
  2450.  
  2451.  
  2452. #define ERRBASE_NONE              0     // No error
  2453. #define ERRBASE_SYSTEM          0x2100  // System related (Fatal Error)
  2454. #define ERRBASE_NOTFOUND        0x2200  // Object of interest Not Found
  2455. #define ERRBASE_DATACORRUPT     0x2300  // Physical Data Corruption
  2456. #define ERRBASE_IO              0x2400  // I/O related error
  2457. #define ERRBASE_LIMIT           0x2500  // Resource or Limit error
  2458. #define ERRBASE_INTEGRITY       0x2600  // Integrity Violation
  2459. #define ERRBASE_INVALIDREQ      0x2700  // Invalid Request
  2460. #define ERRBASE_LOCKCONFLICT    0x2800  // Locking/Contention related
  2461. #define ERRBASE_SEC             0x2900  // Access Violation - Security related
  2462. #define ERRBASE_IC              0x2A00  // Invalid context
  2463. #define ERRBASE_OS              0x2B00  // Os Error not handled by Idapi
  2464. #define ERRBASE_NETWORK         0x2C00  // Network related
  2465. #define ERRBASE_OPTPARAM        0x2D00  // Optional Parameter related
  2466. #define ERRBASE_QUERY           0x2E00  // Query related 
  2467. #define ERRBASE_VERSION         0x2F00  // Version Mismatch Category
  2468. #define ERRBASE_CAPABILITY      0x3000  // Capability not supported
  2469. #define ERRBASE_CONFIG          0x3100  // System configuration error
  2470. #define ERRBASE_WARNING         0x3200  //
  2471. #define ERRBASE_OTHER           0x3300  // Miscellaneous
  2472. #define ERRBASE_COMPATIBILITY   0x3400  // Compatibility related
  2473.  
  2474. #define ERRBASE_DRIVER          0x3E00  // Driver related
  2475. #define ERRBASE_RC              0x3F00  // Internal 
  2476.  
  2477.  
  2478. //=============================================================================
  2479. //                           Error Codes By Category
  2480. //=============================================================================
  2481.  
  2482. // ERRCAT_NONE                  (0)
  2483. // ===========
  2484.  
  2485. #define ERRCODE_NONE             0
  2486.  
  2487. #define DBIERR_NONE                (ERRBASE_NONE + ERRCODE_NONE)
  2488.  
  2489. //  ERRCAT_SYSTEM               
  2490. //  =============
  2491.  
  2492. #define  ERRCODE_SYSFILEOPEN     1   // Cannot open a system file
  2493. #define  ERRCODE_SYSFILEIO       2   // I/O error on a system file
  2494. #define  ERRCODE_SYSCORRUPT      3   // Data structure corruption
  2495. #define  ERRCODE_NOCONFIGFILE    4   // Cannot find config file
  2496. #define  ERRCODE_CFGCANNOTWRITE  5   // Cannot write config file (READONLY)
  2497. #define  ERRCODE_CFGMULTIFILE    6   // Initializing with different ini file 
  2498. #define  ERRCODE_REENTERED       7   // System has been illegally re-entered
  2499. #define  ERRCODE_CANTFINDODAPI   8   // Cannot locate ODAPIxx.DLL
  2500. #define  ERRCODE_CANTLOADODAPI   9   // Cannot load ODAPIxx.DLL
  2501. #define  ERRCODE_CANTLOADLIBRARY 10  // Cannot load a service DLL
  2502.  
  2503. #define  DBIERR_SYSFILEOPEN      (ERRBASE_SYSTEM + ERRCODE_SYSFILEOPEN)
  2504. #define  DBIERR_SYSFILEIO        (ERRBASE_SYSTEM + ERRCODE_SYSFILEIO)
  2505. #define  DBIERR_SYSCORRUPT       (ERRBASE_SYSTEM + ERRCODE_SYSCORRUPT)
  2506. #define  DBIERR_NOCONFIGFILE     (ERRBASE_SYSTEM + ERRCODE_NOCONFIGFILE)
  2507. #define  DBIERR_CFGCANNOTWRITE   (ERRBASE_SYSTEM + ERRCODE_CFGCANNOTWRITE)
  2508. #define  DBIERR_CFGMULTIFILE     (ERRBASE_SYSTEM + ERRCODE_CFGMULTIFILE)
  2509. #define  DBIERR_REENTERED        (ERRBASE_SYSTEM + ERRCODE_REENTERED)
  2510. #define  DBIERR_CANTFINDODAPI    (ERRBASE_SYSTEM + ERRCODE_CANTFINDODAPI)
  2511. #define  DBIERR_CANTLOADODAPI    (ERRBASE_SYSTEM + ERRCODE_CANTLOADODAPI)
  2512. #define  DBIERR_CANTLOADLIBRARY  (ERRBASE_SYSTEM + ERRCODE_CANTLOADLIBRARY)
  2513.  
  2514. //  ERRCAT_NOTFOUND
  2515. //  ===============
  2516.  
  2517. #define  ERRCODE_BOF             1        // Beginning of Virtual table
  2518. #define  ERRCODE_EOF             2        // End of Virtual table
  2519. #define  ERRCODE_RECMOVED        3        // Fly-away
  2520. #define  ERRCODE_KEYORRECDELETED 4        // Record Deleted/Key Modified
  2521. #define  ERRCODE_NOCURRREC       5        // No current record
  2522. #define  ERRCODE_RECNOTFOUND     6        // Record was not found
  2523. #define  ERRCODE_ENDOFBLOB       7        // End of Blob reached
  2524. #define  ERRCODE_OBJNOTFOUND     8        // Generic Not found
  2525. #define  ERRCODE_FMLMEMBERNOTFOUND 9      // Family member not found
  2526. #define  ERRCODE_BLOBFILEMISSING 10       // 0x0a Blob file for table is missing
  2527. #define  ERRCODE_LDNOTFOUND      11       // 0x0b Language driver not found
  2528.  
  2529. #define  DBIERR_BOF              (ERRBASE_NOTFOUND + ERRCODE_BOF)
  2530. #define  DBIERR_EOF              (ERRBASE_NOTFOUND + ERRCODE_EOF)
  2531. #define  DBIERR_RECMOVED         (ERRBASE_NOTFOUND + ERRCODE_RECMOVED)
  2532. #define  DBIERR_RECDELETED       (ERRBASE_NOTFOUND + ERRCODE_KEYORRECDELETED)
  2533. #define  DBIERR_KEYORRECDELETED  (ERRBASE_NOTFOUND + ERRCODE_KEYORRECDELETED)
  2534. #define  DBIERR_NOCURRREC        (ERRBASE_NOTFOUND + ERRCODE_NOCURRREC)
  2535. #define  DBIERR_RECNOTFOUND      (ERRBASE_NOTFOUND + ERRCODE_RECNOTFOUND)
  2536. #define  DBIERR_ENDOFBLOB        (ERRBASE_NOTFOUND + ERRCODE_ENDOFBLOB)
  2537. #define  DBIERR_OBJNOTFOUND      (ERRBASE_NOTFOUND + ERRCODE_OBJNOTFOUND)
  2538. #define  DBIERR_FMLMEMBERNOTFOUND (ERRBASE_NOTFOUND + ERRCODE_FMLMEMBERNOTFOUND)
  2539. #define  DBIERR_BLOBFILEMISSING (ERRBASE_NOTFOUND + ERRCODE_BLOBFILEMISSING)
  2540. #define  DBIERR_LDNOTFOUND (ERRBASE_NOTFOUND + ERRCODE_LDNOTFOUND)
  2541.  
  2542. // ERRCAT_DATACORRUPT
  2543. // ==================
  2544.  
  2545. #define  ERRCODE_HEADERCORRUPT   1        // Corrupt Header
  2546. #define  ERRCODE_FILECORRUPT     2        // File corrupt - other than header
  2547. #define  ERRCODE_MEMOCORRUPT     3        // Memo file corrupted
  2548. #define  ERRCODE_BMPCORRUPT      4        // BitMap is corrupt (Internal error)
  2549. #define  ERRCODE_INDEXCORRUPT    5        // Index is corrupt
  2550. #define  ERRCODE_CORRUPTLOCKFILE 6        // Corrupt lock file
  2551. #define  ERRCODE_FAMFILEINVALID  7        // Corrupt family file
  2552. #define  ERRCODE_VALFILECORRUPT  8        // Val file is missing or corrupt
  2553. #define  ERRCODE_FOREIGNINDEX    9        // Index is in a foreign format - import first
  2554.  
  2555.  
  2556. #define  DBIERR_HEADERCORRUPT    (ERRBASE_DATACORRUPT + ERRCODE_HEADERCORRUPT)
  2557. #define  DBIERR_FILECORRUPT      (ERRBASE_DATACORRUPT + ERRCODE_FILECORRUPT)
  2558. #define  DBIERR_MEMOCORRUPT      (ERRBASE_DATACORRUPT + ERRCODE_MEMOCORRUPT)
  2559. #define  DBIERR_BMPCORRUPT       (ERRBASE_DATACORRUPT + ERRCODE_BMPCORRUPT)
  2560. #define  DBIERR_INDEXCORRUPT     (ERRBASE_DATACORRUPT + ERRCODE_INDEXCORRUPT)
  2561. #define  DBIERR_CORRUPTLOCKFILE  (ERRBASE_DATACORRUPT + ERRCODE_CORRUPTLOCKFILE)
  2562. #define  DBIERR_FAMFILEINVALID   (ERRBASE_DATACORRUPT + ERRCODE_FAMFILEINVALID)
  2563. #define  DBIERR_VALFILECORRUPT   (ERRBASE_DATACORRUPT + ERRCODE_VALFILECORRUPT)
  2564. #define  DBIERR_FOREIGNINDEX     (ERRBASE_DATACORRUPT + ERRCODE_FOREIGNINDEX)
  2565.  
  2566.  
  2567. // ERRCAT_IO
  2568. // =========
  2569.  
  2570. #define  ERRCODE_READERR         1        // Read failure (not expected)
  2571. #define  ERRCODE_WRITEERR        2        // Write failure (not expected)
  2572. #define  ERRCODE_DIRNOACCESS     3        // No access to dir
  2573. #define  ERRCODE_FILEDELETEFAIL  4        // File delete failed
  2574. #define  ERRCODE_FILENOACCESS    5        // No access to file
  2575. #define  ERRCODE_ACCESSDISABLED  6        // Access to table disabled (previous error)
  2576.  
  2577. #define  DBIERR_READERR          (ERRBASE_IO + ERRCODE_READERR)
  2578. #define  DBIERR_WRITEERR         (ERRBASE_IO + ERRCODE_WRITEERR)
  2579. #define  DBIERR_DIRNOACCESS      (ERRBASE_IO + ERRCODE_DIRNOACCESS)
  2580. #define  DBIERR_FILEDELETEFAIL   (ERRBASE_IO + ERRCODE_FILEDELETEFAIL)
  2581. #define  DBIERR_FILENOACCESS     (ERRBASE_IO + ERRCODE_FILENOACCESS)
  2582. #define  DBIERR_ACCESSDISABLED   (ERRBASE_IO + ERRCODE_ACCESSDISABLED)
  2583.  
  2584. // ERRCAT_LIMIT
  2585. // ============
  2586.  
  2587. #define  ERRCODE_NOMEMORY        1        // Not enough Memory for this op
  2588. #define  ERRCODE_NOFILEHANDLES   2        // Not enough File handles
  2589. #define  ERRCODE_NODISKSPACE     3        // Not enough Disk space
  2590. #define  ERRCODE_NOTEMPTBLSPACE  4        // Temporary Table resource limit
  2591. #define  ERRCODE_RECTOOBIG       5        // Too big a record size for table
  2592. #define  ERRCODE_CURSORLIMIT     6        // Too many open cursors
  2593. #define  ERRCODE_TABLEFULL       7        // Table is full
  2594. #define  ERRCODE_WSSESLIMIT      8        // Too many sessions from this WS
  2595. #define  ERRCODE_SERNUMLIMIT     9        // Serial number limit (paradox)
  2596. #define  ERRCODE_INTERNALLIMIT   10       // 0x0a Some internal limit (see context)
  2597. #define  ERRCODE_OPENTBLLIMIT    11       // 0x0b Too many open tables
  2598. #define  ERRCODE_TBLCURSORLIMIT  12       // 0x0c Too many cursors per table
  2599. #define  ERRCODE_RECLOCKLIMIT    13       // 0x0d Too many record locks on table
  2600. #define  ERRCODE_CLIENTSLIMIT    14       // 0x0e Too many clients
  2601. #define  ERRCODE_INDEXLIMIT      15       // 0x0f Too many indexes (also in Table Create)
  2602. #define  ERRCODE_SESSIONSLIMIT   16       // 0x10 Too many sessions
  2603. #define  ERRCODE_DBLIMIT         17       // 0x11 Too many databases
  2604. #define  ERRCODE_PASSWORDLIMIT   18       // 0x12 Too many passwords
  2605. #define  ERRCODE_DRIVERLIMIT     19       // 0x13 Too many active drivers
  2606. #define  ERRCODE_FLDLIMIT        20       // 0x14 Too many Fields in Table Create
  2607. #define  ERRCODE_TBLLOCKLIMIT    21       // 0x15 Too many table locks
  2608. #define  ERRCODE_OPENBLOBLIMIT   22       // 0x16 Too many open blobs 
  2609. #define  ERRCODE_LOCKFILELIMIT   23       // 0x17 Lock file has grown too big
  2610. #define  ERRCODE_OPENQRYLIMIT    24       // 0x18 Too many open queries
  2611. #define  ERRCODE_THREADLIMIT     25       // 0x19 Too many threads for client
  2612. #define  ERRCODE_BLOBLIMIT       26       // 0x1a Too many blobs
  2613. #define  ERRCODE_PDX50NAMELIMIT  27       // 0x1b Pathname is too long for a Paradox 5.0 or less table
  2614.  
  2615. #define  DBIERR_NOMEMORY         (ERRBASE_LIMIT + ERRCODE_NOMEMORY)
  2616. #define  DBIERR_NOFILEHANDLES    (ERRBASE_LIMIT + ERRCODE_NOFILEHANDLES)
  2617. #define  DBIERR_NODISKSPACE      (ERRBASE_LIMIT + ERRCODE_NODISKSPACE)
  2618. #define  DBIERR_NOTEMPTBLSPACE   (ERRBASE_LIMIT + ERRCODE_NOTEMPTBLSPACE)
  2619. #define  DBIERR_RECTOOBIG        (ERRBASE_LIMIT + ERRCODE_RECTOOBIG)
  2620. #define  DBIERR_CURSORLIMIT      (ERRBASE_LIMIT + ERRCODE_CURSORLIMIT)
  2621. #define  DBIERR_TABLEFULL        (ERRBASE_LIMIT + ERRCODE_TABLEFULL)
  2622. #define  DBIERR_WSSESLIMIT       (ERRBASE_LIMIT + ERRCODE_WSSESLIMIT)
  2623. #define  DBIERR_SERNUMLIMIT      (ERRBASE_LIMIT + ERRCODE_SERNUMLIMIT)
  2624. #define  DBIERR_INTERNALLIMIT    (ERRBASE_LIMIT + ERRCODE_INTERNALLIMIT)
  2625. #define  DBIERR_OPENTBLLIMIT     (ERRBASE_LIMIT + ERRCODE_OPENTBLLIMIT)
  2626. #define  DBIERR_TBLCURSORLIMIT   (ERRBASE_LIMIT + ERRCODE_TBLCURSORLIMIT)
  2627. #define  DBIERR_RECLOCKLIMIT     (ERRBASE_LIMIT + ERRCODE_RECLOCKLIMIT)
  2628. #define  DBIERR_CLIENTSLIMIT     (ERRBASE_LIMIT + ERRCODE_CLIENTSLIMIT)
  2629. #define  DBIERR_INDEXLIMIT       (ERRBASE_LIMIT + ERRCODE_INDEXLIMIT)
  2630. #define  DBIERR_SESSIONSLIMIT    (ERRBASE_LIMIT + ERRCODE_SESSIONSLIMIT)
  2631. #define  DBIERR_DBLIMIT          (ERRBASE_LIMIT + ERRCODE_DBLIMIT)
  2632. #define  DBIERR_PASSWORDLIMIT    (ERRBASE_LIMIT + ERRCODE_PASSWORDLIMIT)
  2633. #define  DBIERR_DRIVERLIMIT      (ERRBASE_LIMIT + ERRCODE_DRIVERLIMIT)
  2634. #define  DBIERR_FLDLIMIT         (ERRBASE_LIMIT + ERRCODE_FLDLIMIT)
  2635. #define  DBIERR_TBLLOCKLIMIT     (ERRBASE_LIMIT + ERRCODE_TBLLOCKLIMIT)
  2636. #define  DBIERR_OPENBLOBLIMIT    (ERRBASE_LIMIT + ERRCODE_OPENBLOBLIMIT)
  2637. #define  DBIERR_LOCKFILELIMIT    (ERRBASE_LIMIT + ERRCODE_LOCKFILELIMIT)
  2638. #define  DBIERR_OPENQRYLIMIT     (ERRBASE_LIMIT + ERRCODE_OPENQRYLIMIT)
  2639. #define  DBIERR_THREADLIMIT      (ERRBASE_LIMIT + ERRCODE_THREADLIMIT)
  2640. #define  DBIERR_BLOBLIMIT        (ERRBASE_LIMIT + ERRCODE_BLOBLIMIT)
  2641. #define  DBIERR_PDX50NAMELIMIT   (ERRBASE_LIMIT + ERRCODE_PDX50NAMELIMIT)
  2642.  
  2643.  
  2644. // ERRCAT_INTEGRITY
  2645. // ================
  2646.  
  2647. #define ERRCODE_KEYVIOL             1     // Key violation
  2648. #define ERRCODE_MINVALERR           2     // Min val check failed
  2649. #define ERRCODE_MAXVALERR           3     // Max val check failed
  2650. #define ERRCODE_REQDERR             4     // Field value required
  2651. #define ERRCODE_FORIEGNKEYERR       5     // Master record missing
  2652. #define ERRCODE_DETAILRECORDSEXIST  6     // Cannot MODIFY or DELETE this Master record
  2653. #define ERRCODE_MASTERTBLLEVEL      7     // Master Table Level is incorrect
  2654. #define ERRCODE_LOOKUPTABLEERR      8     // Field value out of lookup tbl range
  2655. #define ERRCODE_LOOKUPTBLOPENERR    9     // Lookup Table Open failed
  2656. #define ERRCODE_DETAILTBLOPENERR   10     // 0x0a Detail Table Open failed
  2657. #define ERRCODE_MASTERTBLOPENERR   11     // 0x0b Master Table Open failed
  2658. #define ERRCODE_FIELDISBLANK       12     // 0x0c Field is blank
  2659.  
  2660. #define ERRCODE_MASTEREXISTS       13     // 0x0d Master Table exists
  2661. #define ERRCODE_MASTERTBLOPEN      14     // 0x0e Master Table is open
  2662.  
  2663. #define ERRCODE_DETAILTABLESEXIST    15   // 0x0f Detail Tables exist ( cannot delete, rename ... )
  2664. #define ERRCODE_DETAILRECEXISTEMPTY  16   // 0x10 Cannot empty because details exist
  2665. #define ERRCODE_MASTERREFERENCEERR   17   // 0x11 Cannot modify while adding self referencing Referential Integrity
  2666. #define ERRCODE_DETAILTBLOPEN        18   // 0x12 Detail Table is opened
  2667. #define ERRCODE_DEPENDENTSMUSTBEEMPTY  19 // 0x13 Cannot make a master a detail of another table if its details are not empty !
  2668. #define ERRCODE_RINTREQINDEX         20   // 0x14 Ref. integrity fields must be indexed
  2669. #define ERRCODE_LINKEDTBLPROTECTED   21   // 0x15 Master Table is protected ( requires password to open)
  2670. #define ERRCODE_FIELDMULTILINKED     22   // 0x16 Field has more than one master
  2671.                  
  2672.                
  2673. #define DBIERR_KEYVIOL             (ERRBASE_INTEGRITY + ERRCODE_KEYVIOL)
  2674. #define DBIERR_MINVALERR           (ERRBASE_INTEGRITY + ERRCODE_MINVALERR)
  2675. #define DBIERR_MAXVALERR           (ERRBASE_INTEGRITY + ERRCODE_MAXVALERR)
  2676. #define DBIERR_REQDERR             (ERRBASE_INTEGRITY + ERRCODE_REQDERR)
  2677. #define DBIERR_FORIEGNKEYERR       (ERRBASE_INTEGRITY + ERRCODE_FORIEGNKEYERR)
  2678. #define DBIERR_DETAILRECORDSEXIST  (ERRBASE_INTEGRITY + ERRCODE_DETAILRECORDSEXIST)
  2679. #define DBIERR_MASTERTBLLEVEL      (ERRBASE_INTEGRITY + ERRCODE_MASTERTBLLEVEL)
  2680. #define DBIERR_LOOKUPTABLEERR      (ERRBASE_INTEGRITY + ERRCODE_LOOKUPTABLEERR)
  2681. #define DBIERR_LOOKUPTBLOPENERR    (ERRBASE_INTEGRITY + ERRCODE_LOOKUPTBLOPENERR)
  2682. #define DBIERR_DETAILTBLOPENERR    (ERRBASE_INTEGRITY + ERRCODE_DETAILTBLOPENERR)
  2683. #define DBIERR_MASTERTBLOPENERR    (ERRBASE_INTEGRITY + ERRCODE_MASTERTBLOPENERR)
  2684. #define DBIERR_FIELDISBLANK        (ERRBASE_INTEGRITY + ERRCODE_FIELDISBLANK)
  2685. #define DBIERR_MASTEREXISTS        (ERRBASE_INTEGRITY + ERRCODE_MASTEREXISTS)
  2686. #define DBIERR_MASTERTBLOPEN       (ERRBASE_INTEGRITY + ERRCODE_MASTERTBLOPEN)
  2687. #define DBIERR_DETAILTABLESEXIST   (ERRBASE_INTEGRITY + ERRCODE_DETAILTABLESEXIST)
  2688. #define DBIERR_DETAILRECEXISTEMPTY (ERRBASE_INTEGRITY + ERRCODE_DETAILRECEXISTEMPTY)
  2689. #define DBIERR_MASTERREFERENCEERR  (ERRBASE_INTEGRITY + ERRCODE_MASTERREFERENCEERR)
  2690. #define DBIERR_DETAILTBLOPEN       (ERRBASE_INTEGRITY + ERRCODE_DETAILTBLOPEN)
  2691. #define DBIERR_DEPENDENTSMUSTBEEMPTY  (ERRBASE_INTEGRITY + ERRCODE_DEPENDENTSMUSTBEEMPTY)
  2692. #define DBIERR_RINTREQINDEX        (ERRBASE_INTEGRITY + ERRCODE_RINTREQINDEX)
  2693. #define DBIERR_LINKEDTBLPROTECTED  (ERRBASE_INTEGRITY + ERRCODE_LINKEDTBLPROTECTED)
  2694. #define DBIERR_FIELDMULTILINKED    (ERRBASE_INTEGRITY + ERRCODE_FIELDMULTILINKED)
  2695.  
  2696.  
  2697.  
  2698. // ERRCAT_INVALIDREQ
  2699. // =================
  2700.  
  2701. #define  ERRCODE_OUTOFRANGE           1     // Number out of range (e.g field no)
  2702. #define  ERRCODE_INVALIDPARAM         2     // Generic invalid parameter
  2703. #define  ERRCODE_INVALIDFILENAME      3     // Invalid file name
  2704. #define  ERRCODE_NOSUCHFILE           4     // No such file
  2705. #define  ERRCODE_INVALIDOPTION        5     // Invalid option for a parameter
  2706. #define  ERRCODE_INVALIDHNDL          6     // Invalid handle to the function
  2707. #define  ERRCODE_UNKNOWNTBLTYPE       7     // Table type given not known
  2708. #define  ERRCODE_UNKNOWNFILE          8     // Dont know how to open file
  2709. #define  ERRCODE_PRIMARYKEYREDEFINE   9     // Cannot redefine primary key
  2710. #define  ERRCODE_INVALIDRINTDESCNUM   10    // 0x0a Cannot change this RINTDesc
  2711. #define  ERRCODE_KEYFLDTYPEMISMATCH   11    // 0x0b Foreign & Primary Key Mismatch
  2712. #define  ERRCODE_INVALIDMODIFYREQUEST 12    // 0x0c Invalid modify request
  2713. #define  ERRCODE_NOSUCHINDEX          13    // 0x0d Index does not exist
  2714. #define  ERRCODE_INVALIDBLOBOFFSET    14    // 0x0e Invalid Offset into the Blob
  2715. #define  ERRCODE_INVALIDDESCNUM       15    // 0x0f Invalid descriptor number
  2716. #define  ERRCODE_INVALIDFLDTYPE       16    // 0x10 Invalid field type
  2717. #define  ERRCODE_INVALIDFLDDESC       17    // 0x11 Invalid field descriptor
  2718. #define  ERRCODE_INVALIDFLDXFORM      18    // 0x12 Invalid field transform
  2719. #define  ERRCODE_INVALIDRECSTRUCT     19    // 0x13 Invalid record structure
  2720. #define  ERRCODE_INVALIDDESC          20    // 0x14 Generic: invalid descriptor
  2721. #define  ERRCODE_INVALIDINDEXSTRUCT   21    // 0x15 Invalid array of indexes descriptors
  2722. #define  ERRCODE_INVALIDVCHKSTRUCT    22    // 0x16 Invalid array of  val. check descriptors
  2723. #define  ERRCODE_INVALIDRINTSTRUCT    23    // 0x17 Invalid array of ref. integrity descriptors
  2724. #define  ERRCODE_INVALIDRESTRTBLORDER 24    // 0x18 Invalid ordering of tables during restructure
  2725. #define  ERRCODE_NAMENOTUNIQUE        25    // 0x19 Name not unique in this context
  2726. #define  ERRCODE_INDEXNAMEREQUIRED    26    // 0x1a Index name required
  2727. #define  ERRCODE_INVALIDSESHANDLE     27    // 0x1b Invalid ses handle
  2728. #define  ERRCODE_INVALIDRESTROP       28    // 0x1c Invalid restructure operation
  2729. #define  ERRCODE_UNKNOWNDRIVER        29    // 0x1d Driver not known to system
  2730. #define  ERRCODE_UNKNOWNDB            30    // 0x1e Unknown db
  2731. #define  ERRCODE_INVALIDPASSWORD      31    // 0x1f Invalid password given
  2732. #define  ERRCODE_NOCALLBACK           32    // 0x20 No callback function
  2733. #define  ERRCODE_INVALIDCALLBACKBUFLEN 33   // 0x21 Invalid callback buffer length
  2734. #define  ERRCODE_INVALIDDIR            34   // 0x22 Invalid directory
  2735. #define  ERRCODE_INVALIDXLATION        35   // 0x23 Translate Error - Translate DID NOT happen 
  2736. #define  ERRCODE_DIFFERENTTABLES       36   // 0x24 Cannot Set Cursor of one Table to another 
  2737. #define  ERRCODE_INVALIDBOOKMARK       37   // 0x25 Bookmarks does not match table, etc.
  2738. #define  ERRCODE_INVALIDINDEXNAME      38   // 0x26 Index/Tag Name is invalid
  2739. #define  ERRCODE_INVALIDIDXDESC        39   // 0x27 Invalid index descriptor
  2740. #define  ERRCODE_NOSUCHTABLE           40   // 0x28 No such table
  2741. #define  ERRCODE_USECOUNT              41   // 0x29 Table has too many users
  2742. #define  ERRCODE_INVALIDKEY            42   // 0x2a Key does not pass filter condition
  2743. #define  ERRCODE_INDEXEXISTS           43   // 0x2b Index already exists
  2744. #define  ERRCODE_INDEXOPEN             44   // 0x2c Index is open
  2745. #define  ERRCODE_INVALIDBLOBLEN        45   // 0x2d Invalid Blob Length
  2746. #define  ERRCODE_INVALIDBLOBHANDLE     46   // 0x2e Invalid Blob handle (in record buffer)
  2747. #define  ERRCODE_TABLEOPEN             47   // 0x2f Table is open
  2748. #define  ERRCODE_NEEDRESTRUCTURE       48   // 0x30 Need to do (hard) restructure
  2749. #define  ERRCODE_INVALIDMODE           49   // 0x31 Invalid mode
  2750. #define  ERRCODE_CANNOTCLOSE            50  // 0x32 Cannot close index
  2751. #define  ERRCODE_ACTIVEINDEX            51  // 0x33 Index is being used to order tbl
  2752. #define  ERRCODE_INVALIDUSRPASS         52  // 0x34 Bad user name or password
  2753. #define  ERRCODE_MULTILEVELCASCADE      53  // 0x35 Multi level Cascade not supported
  2754. #define  ERRCODE_INVALIDFIELDNAME       54  // 0x36 Invalid field name
  2755. #define  ERRCODE_INVALIDTABLENAME       55  // 0x37 Invalid table name
  2756. #define  ERRCODE_INVALIDLINKEXPR        56  // 0x38 Invalid linked cursor expression
  2757. #define  ERRCODE_NAMERESERVED           57  // 0x39 Name is reserved
  2758. #define  ERRCODE_INVALIDFILEEXTN        58  // 0x3a Invalid file extention
  2759. #define  ERRCODE_INVALIDLANGDRV         59  // 0x3b Invalid language driver
  2760. #define  ERRCODE_ALIASNOTOPEN           60  // 0x3c Requested alias in not open
  2761. #define  ERRCODE_INCOMPATRECSTRUCTS     61  // 0x3d Incompatible record structures
  2762. #define  ERRCODE_RESERVEDDOSNAME        62  // 0x3e Reserved dos name
  2763. #define  ERRCODE_DESTMUSTBEINDEXED      63  // 0x3f Destination must be indexed
  2764. #define  ERRCODE_INVALIDINDEXTYPE       64  // 0x40 Invalid index type
  2765. #define  ERRCODE_LANGDRVMISMATCH        65  // 0x41 Language driver of table and index do not match
  2766. #define  ERRCODE_NOSUCHFILTER           66  // 0x42 Filter handle is invalid
  2767. #define  ERRCODE_INVALIDFILTER          67  // 0x43 Invalid filter
  2768.  
  2769. #define  ERRCODE_INVALIDTABLECREATE     68  // 0x44 Bad table create request (exact prob unknown)
  2770. #define  ERRCODE_INVALIDTABLEDELETE     69  // 0x45 Bad table delete request (exact prob unknown)
  2771. #define  ERRCODE_INVALIDINDEXCREATE     70  // 0x46 Bad index create request (exact prob unknown)
  2772. #define  ERRCODE_INVALIDINDEXDELETE     71  // 0x47 Bad index delete request (exact prob unknown)
  2773. #define  ERRCODE_INVALIDTABLE           72  // 0x48 Invalid table name specified
  2774. #define  ERRCODE_MULTIRESULTS           73  // 0X49 Multi results
  2775. #define  ERRCODE_INVALIDTIME            74  // 0X4A Multi results
  2776. #define  ERRCODE_INVALIDDATE            75  // 0X4B Multi results
  2777. #define  ERRCODE_INVALIDTIMESTAMP       76  // 0X4C Multi results
  2778. #define  ERRCODE_DIFFERENTPATH          77  // 0X4d Tables in different paths 
  2779. #define  ERRCODE_MISMATCHARGS           78  // 0x4e MisMatch in the # of arguments
  2780. #define  ERRCODE_FUNCTIONNOTFOUND       79  // 0x4f Loaderlib cant find a func in the DLL (bad version?)
  2781. #define  ERRCODE_MUSTUSEBASEORDER       80  // 0x50 Must use baseorder for this operation
  2782. #define  ERRCODE_INVALIDPROCEDURENAME   81  // 0x51 Invalid procedure name
  2783.  
  2784.                                              
  2785. #define  DBIERR_OUTOFRANGE           (ERRBASE_INVALIDREQ + ERRCODE_OUTOFRANGE)
  2786. #define  DBIERR_INVALIDPARAM         (ERRBASE_INVALIDREQ + ERRCODE_INVALIDPARAM)
  2787. #define  DBIERR_INVALIDFILENAME      (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFILENAME)
  2788. #define  DBIERR_NOSUCHFILE           (ERRBASE_INVALIDREQ + ERRCODE_NOSUCHFILE)
  2789. #define  DBIERR_INVALIDOPTION        (ERRBASE_INVALIDREQ + ERRCODE_INVALIDOPTION)
  2790. #define  DBIERR_INVALIDHNDL          (ERRBASE_INVALIDREQ + ERRCODE_INVALIDHNDL)
  2791. #define  DBIERR_UNKNOWNTBLTYPE       (ERRBASE_INVALIDREQ + ERRCODE_UNKNOWNTBLTYPE)
  2792. #define  DBIERR_UNKNOWNFILE          (ERRBASE_INVALIDREQ + ERRCODE_UNKNOWNFILE)
  2793. #define  DBIERR_PRIMARYKEYREDEFINE   (ERRBASE_INVALIDREQ + ERRCODE_PRIMARYKEYREDEFINE)
  2794. #define  DBIERR_INVALIDRINTDESCNUM   (ERRBASE_INVALIDREQ + ERRCODE_INVALIDRINTDESCNUM)
  2795. #define  DBIERR_KEYFLDTYPEMISMATCH   (ERRBASE_INVALIDREQ + ERRCODE_KEYFLDTYPEMISMATCH)
  2796. #define  DBIERR_INVALIDMODIFYREQUEST (ERRBASE_INVALIDREQ + ERRCODE_INVALIDMODIFYREQUEST)
  2797. #define  DBIERR_NOSUCHINDEX          (ERRBASE_INVALIDREQ + ERRCODE_NOSUCHINDEX)
  2798. #define  DBIERR_INVALIDBLOBOFFSET    (ERRBASE_INVALIDREQ + ERRCODE_INVALIDBLOBOFFSET)
  2799. #define  DBIERR_INVALIDDESCNUM       (ERRBASE_INVALIDREQ + ERRCODE_INVALIDDESCNUM)
  2800. #define  DBIERR_INVALIDFLDTYPE       (ERRBASE_INVALIDREQ +  ERRCODE_INVALIDFLDTYPE)
  2801. #define  DBIERR_INVALIDFLDDESC       (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFLDDESC)
  2802. #define  DBIERR_INVALIDFLDXFORM      (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFLDXFORM)
  2803. #define  DBIERR_INVALIDRECSTRUCT     (ERRBASE_INVALIDREQ + ERRCODE_INVALIDRECSTRUCT)
  2804. #define  DBIERR_INVALIDDESC          (ERRBASE_INVALIDREQ + ERRCODE_INVALIDDESC)
  2805. #define  DBIERR_INVALIDINDEXSTRUCT   (ERRBASE_INVALIDREQ + ERRCODE_INVALIDINDEXSTRUCT)
  2806. #define  DBIERR_INVALIDVCHKSTRUCT    (ERRBASE_INVALIDREQ + ERRCODE_INVALIDVCHKSTRUCT)
  2807. #define  DBIERR_INVALIDRINTSTRUCT    (ERRBASE_INVALIDREQ + ERRCODE_INVALIDRINTSTRUCT)
  2808. #define  DBIERR_INVALIDRESTRTBLORDER (ERRBASE_INVALIDREQ + ERRCODE_INVALIDRESTRTBLORDER)
  2809. #define  DBIERR_NAMENOTUNIQUE        (ERRBASE_INVALIDREQ + ERRCODE_NAMENOTUNIQUE)
  2810. #define  DBIERR_INDEXNAMEREQUIRED    (ERRBASE_INVALIDREQ + ERRCODE_INDEXNAMEREQUIRED)
  2811. #define  DBIERR_INVALIDSESHANDLE     (ERRBASE_INVALIDREQ + ERRCODE_INVALIDSESHANDLE)
  2812. #define  DBIERR_INVALIDRESTROP       (ERRBASE_INVALIDREQ + ERRCODE_INVALIDRESTROP)
  2813. #define  DBIERR_UNKNOWNDRIVER        (ERRBASE_INVALIDREQ + ERRCODE_UNKNOWNDRIVER)
  2814. #define  DBIERR_UNKNOWNDB            (ERRBASE_INVALIDREQ + ERRCODE_UNKNOWNDB)
  2815. #define  DBIERR_INVALIDPASSWORD      (ERRBASE_INVALIDREQ + ERRCODE_INVALIDPASSWORD)
  2816. #define  DBIERR_NOCALLBACK           (ERRBASE_INVALIDREQ + ERRCODE_NOCALLBACK)
  2817. #define  DBIERR_INVALIDCALLBACKBUFLEN \
  2818.   (ERRBASE_INVALIDREQ + ERRCODE_INVALIDCALLBACKBUFLEN )
  2819. #define  DBIERR_INVALIDDIR          (ERRBASE_INVALIDREQ + ERRCODE_INVALIDDIR)
  2820. #define  DBIERR_INVALIDXLATION      (ERRBASE_INVALIDREQ + ERRCODE_INVALIDXLATION)
  2821. #define  DBIERR_DIFFERENTTABLES     (ERRBASE_INVALIDREQ + ERRCODE_DIFFERENTTABLES)
  2822. #define  DBIERR_INVALIDBOOKMARK     (ERRBASE_INVALIDREQ + ERRCODE_INVALIDBOOKMARK)
  2823. #define  DBIERR_INVALIDINDEXNAME    (ERRBASE_INVALIDREQ + ERRCODE_INVALIDINDEXNAME)
  2824. #define  DBIERR_INVALIDIDXDESC      (ERRBASE_INVALIDREQ + ERRCODE_INVALIDIDXDESC)
  2825. #define  DBIERR_NOSUCHTABLE         (ERRBASE_INVALIDREQ + ERRCODE_NOSUCHTABLE)
  2826. #define  DBIERR_USECOUNT            (ERRBASE_INVALIDREQ + ERRCODE_USECOUNT)
  2827. #define  DBIERR_INVALIDKEY          (ERRBASE_INVALIDREQ + ERRCODE_INVALIDKEY)
  2828. #define  DBIERR_INDEXEXISTS         (ERRBASE_INVALIDREQ + ERRCODE_INDEXEXISTS)
  2829. #define  DBIERR_INDEXOPEN           (ERRBASE_INVALIDREQ + ERRCODE_INDEXOPEN)
  2830. #define  DBIERR_INVALIDBLOBLEN      (ERRBASE_INVALIDREQ + ERRCODE_INVALIDBLOBLEN)
  2831. #define  DBIERR_INVALIDBLOBHANDLE   (ERRBASE_INVALIDREQ + ERRCODE_INVALIDBLOBHANDLE)
  2832. #define  DBIERR_TABLEOPEN           (ERRBASE_INVALIDREQ + ERRCODE_TABLEOPEN)
  2833. #define  DBIERR_NEEDRESTRUCTURE     (ERRBASE_INVALIDREQ + ERRCODE_NEEDRESTRUCTURE)
  2834. #define  DBIERR_INVALIDMODE         (ERRBASE_INVALIDREQ + ERRCODE_INVALIDMODE)
  2835. #define  DBIERR_CANNOTCLOSE         (ERRBASE_INVALIDREQ + ERRCODE_CANNOTCLOSE)
  2836. #define  DBIERR_ACTIVEINDEX         (ERRBASE_INVALIDREQ + ERRCODE_ACTIVEINDEX)
  2837. #define  DBIERR_INVALIDUSRPASS      (ERRBASE_INVALIDREQ + ERRCODE_INVALIDUSRPASS)
  2838. #define  DBIERR_MULTILEVELCASCADE   (ERRBASE_INVALIDREQ + ERRCODE_MULTILEVELCASCADE)
  2839. #define  DBIERR_INVALIDFIELDNAME    (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFIELDNAME)
  2840. #define  DBIERR_INVALIDTABLENAME    (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTABLENAME)
  2841. #define  DBIERR_INVALIDLINKEXPR     (ERRBASE_INVALIDREQ + ERRCODE_INVALIDLINKEXPR)
  2842. #define  DBIERR_NAMERESERVED        (ERRBASE_INVALIDREQ + ERRCODE_NAMERESERVED)
  2843. #define  DBIERR_INVALIDFILEEXTN     (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFILEEXTN)
  2844. #define  DBIERR_INVALIDLANGDRV      (ERRBASE_INVALIDREQ + ERRCODE_INVALIDLANGDRV)
  2845. #define  DBIERR_ALIASNOTOPEN        (ERRBASE_INVALIDREQ + ERRCODE_ALIASNOTOPEN)
  2846. #define  DBIERR_INCOMPATRECSTRUCTS  (ERRBASE_INVALIDREQ + ERRCODE_INCOMPATRECSTRUCTS)
  2847. #define  DBIERR_RESERVEDOSNAME      (ERRBASE_INVALIDREQ + ERRCODE_RESERVEDDOSNAME)
  2848. #define  DBIERR_DESTMUSTBEINDEXED   (ERRBASE_INVALIDREQ + ERRCODE_DESTMUSTBEINDEXED)
  2849. #define  DBIERR_INVALIDINDEXTYPE    (ERRBASE_INVALIDREQ + ERRCODE_INVALIDINDEXTYPE)
  2850. #define  DBIERR_LANGDRVMISMATCH     (ERRBASE_INVALIDREQ + ERRCODE_LANGDRVMISMATCH)
  2851. #define  DBIERR_NOSUCHFILTER        (ERRBASE_INVALIDREQ + ERRCODE_NOSUCHFILTER)
  2852. #define  DBIERR_INVALIDFILTER       (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFILTER)
  2853. #define  DBIERR_INVALIDTABLECREATE  (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTABLECREATE)
  2854. #define  DBIERR_INVALIDTABLEDELETE  (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTABLEDELETE)
  2855. #define  DBIERR_INVALIDINDEXCREATE  (ERRBASE_INVALIDREQ + ERRCODE_INVALIDINDEXCREATE)
  2856. #define  DBIERR_INVALIDINDEXDELETE  (ERRBASE_INVALIDREQ + ERRCODE_INVALIDINDEXDELETE)
  2857. #define  DBIERR_INVALIDTABLE        (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTABLE)
  2858. #define  DBIERR_MULTIRESULTS        (ERRBASE_INVALIDREQ + ERRCODE_MULTIRESULTS)
  2859. #define  DBIERR_INVALIDTIME         (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTIME)
  2860. #define  DBIERR_INVALIDDATE         (ERRBASE_INVALIDREQ + ERRCODE_INVALIDDATE)
  2861. #define  DBIERR_INVALIDTIMESTAMP    (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTIMESTAMP)
  2862. #define  DBIERR_DIFFERENTPATH       (ERRBASE_INVALIDREQ + ERRCODE_DIFFERENTPATH)
  2863. #define  DBIERR_MISMATCHARGS        (ERRBASE_INVALIDREQ + ERRCODE_MISMATCHARGS)
  2864. #define  DBIERR_FUNCTIONNOTFOUND    (ERRBASE_INVALIDREQ + ERRCODE_FUNCTIONNOTFOUND)
  2865. #define  DBIERR_MUSTUSEBASEORDER    (ERRBASE_INVALIDREQ + ERRCODE_MUSTUSEBASEORDER)
  2866. #define  DBIERR_INVALIDPROCEDURENAME (ERRBASE_INVALIDREQ + ERRCODE_INVALIDPROCEDURENAME)
  2867.                                                              
  2868. // ERRCAT_LOCKCONFLICT
  2869. // ===================
  2870.  
  2871. #define ERRCODE_LOCKED           1
  2872. #define ERRCODE_UNLOCKFAILED     2
  2873. #define ERRCODE_FILEBUSY         3
  2874. #define ERRCODE_DIRBUSY          4
  2875. #define ERRCODE_FILELOCKED       5
  2876. #define ERRCODE_DIRLOCKED        6
  2877. #define ERRCODE_ALREADYLOCKED    7
  2878. #define ERRCODE_NOTLOCKED        8
  2879. #define ERRCODE_LOCKTIMEOUT      9
  2880. #define ERRCODE_GROUPLOCKED      10    // 0x0a
  2881. #define ERRCODE_LOSTTBLLOCK      11    // 0x0b
  2882. #define ERRCODE_LOSTEXCLACCESS   12    // 0x0c
  2883. #define ERRCODE_NEEDEXCLACCESS   13    // 0x0d
  2884. #define ERRCODE_RECGROUPCONFLICT 14    // 0x0e
  2885. #define ERRCODE_DEADLOCK         15
  2886. #define ERRCODE_ACTIVETRAN       16
  2887. #define ERRCODE_NOACTIVETRAN     17
  2888. #define ERRCODE_RECLOCKFAILED    18
  2889. #define ERRCODE_OPTRECLOCKFAILED 19
  2890. #define ERRCODE_OPTRECLOCKRECDEL 20
  2891. #define ERRCODE_LOCKEDRECS       21
  2892. #define ERRCODE_NEEDWRITELOCK    22
  2893.  
  2894. #define DBIERR_LOCKED            (ERRBASE_LOCKCONFLICT + ERRCODE_LOCKED)
  2895. #define DBIERR_UNLOCKFAILED      (ERRBASE_LOCKCONFLICT + ERRCODE_UNLOCKFAILED)
  2896. #define DBIERR_FILEBUSY          (ERRBASE_LOCKCONFLICT + ERRCODE_FILEBUSY)
  2897. #define DBIERR_DIRBUSY           (ERRBASE_LOCKCONFLICT + ERRCODE_DIRBUSY)
  2898. #define DBIERR_FILELOCKED        (ERRBASE_LOCKCONFLICT + ERRCODE_FILELOCKED)
  2899. #define DBIERR_DIRLOCKED         (ERRBASE_LOCKCONFLICT + ERRCODE_DIRLOCKED)
  2900. #define DBIERR_ALREADYLOCKED     (ERRBASE_LOCKCONFLICT + ERRCODE_ALREADYLOCKED)
  2901. #define DBIERR_NOTLOCKED         (ERRBASE_LOCKCONFLICT + ERRCODE_NOTLOCKED)
  2902. #define DBIERR_LOCKTIMEOUT       (ERRBASE_LOCKCONFLICT + ERRCODE_LOCKTIMEOUT)
  2903. #define DBIERR_GROUPLOCKED       (ERRBASE_LOCKCONFLICT + ERRCODE_GROUPLOCKED)
  2904. #define DBIERR_LOSTTBLLOCK       (ERRBASE_LOCKCONFLICT + ERRCODE_LOSTTBLLOCK)
  2905. #define DBIERR_LOSTEXCLACCESS    (ERRBASE_LOCKCONFLICT + ERRCODE_LOSTEXCLACCESS)
  2906. #define DBIERR_NEEDEXCLACCESS    (ERRBASE_LOCKCONFLICT  + ERRCODE_NEEDEXCLACCESS)
  2907. #define DBIERR_RECGROUPCONFLICT  (ERRBASE_LOCKCONFLICT + ERRCODE_RECGROUPCONFLICT)
  2908. #define DBIERR_DEADLOCK          (ERRBASE_LOCKCONFLICT + ERRCODE_DEADLOCK)
  2909. #define DBIERR_ACTIVETRAN        (ERRBASE_LOCKCONFLICT + ERRCODE_ACTIVETRAN)
  2910. #define DBIERR_NOACTIVETRAN      (ERRBASE_LOCKCONFLICT + ERRCODE_NOACTIVETRAN)
  2911. #define DBIERR_RECLOCKFAILED     (ERRBASE_LOCKCONFLICT + ERRCODE_RECLOCKFAILED)
  2912. #define DBIERR_OPTRECLOCKFAILED  (ERRBASE_LOCKCONFLICT + ERRCODE_OPTRECLOCKFAILED)
  2913. #define DBIERR_OPTRECLOCKRECDEL  (ERRBASE_LOCKCONFLICT + ERRCODE_OPTRECLOCKRECDEL)
  2914.  
  2915. // ERRCAT_SECURITY
  2916. // ===============
  2917.  
  2918. #define ERRCODE_NOTSUFFFIELDRIGHTS   1        // Not sufficient field  rights for operation
  2919. #define ERRCODE_NOTSUFFTABLERIGHTS   2        // Not sufficient table  rights for operation
  2920. #define ERRCODE_NOTSUFFFAMILYRIGHTS  3        // Not sufficient family rights for operation
  2921. #define ERRCODE_READONLYDIR          4        // Is a read-only directory
  2922. #define ERRCODE_READONLYDB           5        // Database is read-only
  2923. #define ERRCODE_READONLYFLD          6        // Trying to modify read-only field
  2924. #define ERRCODE_TBLENCRYPTED         7        // Table is encrypted (dBASE only)
  2925. #define ERRCODE_NOTSUFFSQLRIGHTS     8        // Not sufficient sql rights for operation
  2926.  
  2927.  
  2928. #define DBIERR_NOTSUFFFIELDRIGHTS  (ERRBASE_SEC + ERRCODE_NOTSUFFFIELDRIGHTS)
  2929. #define DBIERR_NOTSUFFTABLERIGHTS  (ERRBASE_SEC + ERRCODE_NOTSUFFTABLERIGHTS)
  2930. #define DBIERR_NOTSUFFFAMILYRIGHTS (ERRBASE_SEC + ERRCODE_NOTSUFFFAMILYRIGHTS)
  2931. #define DBIERR_READONLYDIR         (ERRBASE_SEC + ERRCODE_READONLYDIR)
  2932. #define DBIERR_READONLYDB          (ERRBASE_SEC + ERRCODE_READONLYDB)
  2933. #define DBIERR_READONLYFLD         (ERRBASE_SEC + ERRCODE_READONLYFLD)
  2934. #define DBIERR_TBLENCRYPTED        (ERRBASE_SEC + ERRCODE_TBLENCRYPTED)
  2935. #define DBIERR_NOTSUFFSQLRIGHTS    (ERRBASE_SEC + ERRCODE_NOTSUFFSQLRIGHTS) 
  2936.  
  2937.  
  2938. // ERRCAT_INVALIDCONTEXT
  2939. // =====================
  2940.  
  2941. #define ERRCODE_NOTABLOB         1        // Field is not a blob
  2942. #define ERRCODE_BLOBOPENED       2        // Blob already opened
  2943. #define ERRCODE_BLOBNOTOPENED    3        // Blob not opened
  2944. #define ERRCODE_NA               4        // Operation not applicable
  2945. #define ERRCODE_NOTINDEXED       5        // Table is not indexed
  2946. #define ERRCODE_NOTINITIALIZED   6        // Engine not initialized
  2947. #define ERRCODE_MULTIPLEINIT     7        // Attempt to re-initialize engine
  2948. #define ERRCODE_NOTSAMESESSION   8        // Attempt to mix objs from diff ses
  2949. #define ERRCODE_PDXDRIVERNOTACTIVE 9      // Paradox driver not active
  2950. #define ERRCODE_DRIVERNOTLOADED  10       // 0x0a Driver not loaded
  2951. #define ERRCODE_TABLEREADONLY    11       // 0x0b Table is read only
  2952. #define ERRCODE_NOASSOCINDEX     12       // 0x0c No index associated with the cursor
  2953. #define ERRCODE_HASOPENCURSORS   13       // 0x0d Has open cursors
  2954. #define ERRCODE_NOTABLESUPPORT   14       // 0x0e Op cannot be done on this table
  2955. #define ERRCODE_INDEXREADONLY    15       // 0x0f Index is read only 
  2956. #define ERRCODE_NOUNIQUERECS     16       // 0x10 Records are not unique
  2957. #define ERRCODE_NOTCURSESSION    17       // 0x11 Not the current/active session
  2958. #define ERRCODE_INVALIDKEYWORD   18       // 0x12 Invalid use of keyword.
  2959. #define ERRCODE_CONNECTINUSE     19       // 0x13 Connection in use
  2960. #define ERRCODE_CONNECTNOTSHARED 20       // 0x14 Passthru SQL connection not share
  2961.  
  2962.  
  2963. #define DBIERR_NOTABLOB           (ERRBASE_IC + ERRCODE_NOTABLOB)
  2964. #define DBIERR_BLOBOPENED         (ERRBASE_IC + ERRCODE_BLOBOPENED)
  2965. #define DBIERR_BLOBNOTOPENED      (ERRBASE_IC + ERRCODE_BLOBNOTOPENED)
  2966. #define DBIERR_NA                 (ERRBASE_IC + ERRCODE_NA)
  2967. #define DBIERR_NOTINDEXED         (ERRBASE_IC + ERRCODE_NOTINDEXED)
  2968. #define DBIERR_NOTINITIALIZED     (ERRBASE_IC + ERRCODE_NOTINITIALIZED)
  2969. #define DBIERR_MULTIPLEINIT       (ERRBASE_IC + ERRCODE_MULTIPLEINIT)
  2970. #define DBIERR_NOTSAMESESSION     (ERRBASE_IC + ERRCODE_NOTSAMESESSION)
  2971. #define DBIERR_PDXDRIVERNOTACTIVE (ERRBASE_IC + ERRCODE_PDXDRIVERNOTACTIVE)
  2972. #define DBIERR_DRIVERNOTLOADED    (ERRBASE_IC + ERRCODE_DRIVERNOTLOADED)
  2973. #define DBIERR_TABLEREADONLY      (ERRBASE_IC + ERRCODE_TABLEREADONLY)
  2974. #define DBIERR_NOASSOCINDEX       (ERRBASE_IC + ERRCODE_NOASSOCINDEX)
  2975. #define DBIERR_HASOPENCURSORS     (ERRBASE_IC + ERRCODE_HASOPENCURSORS)
  2976. #define DBIERR_NOTABLESUPPORT     (ERRBASE_IC + ERRCODE_NOTABLESUPPORT)
  2977. #define DBIERR_INDEXREADONLY      (ERRBASE_IC + ERRCODE_INDEXREADONLY)
  2978. #define DBIERR_NOUNIQUERECS       (ERRBASE_IC + ERRCODE_NOUNIQUERECS)
  2979. #define DBIERR_NOTCURSESSION      (ERRBASE_IC + ERRCODE_NOTCURSESSION)
  2980. #define DBIERR_INVALIDKEYWORD     (ERRBASE_IC + ERRCODE_INVALIDKEYWORD)
  2981. #define DBIERR_CONNECTINUSE       (ERRBASE_IC + ERRCODE_CONNECTINUSE)
  2982. #define DBIERR_CONNECTNOTSHARED   (ERRBASE_IC + ERRCODE_CONNECTNOTSHARED)
  2983.  
  2984.  
  2985. // ERRCAT_OS
  2986. // =========
  2987. // DOS extended errors:
  2988.  
  2989. #define ERRCODE_OSEINVFNC     1        // Invalid function number
  2990. #define ERRCODE_OSENOENT      2        // No such file or directory
  2991. #define ERRCODE_OSENOPATH     3        // Path not found
  2992. #define ERRCODE_OSEMFILE      4        // Too many open files
  2993. #define ERRCODE_OSEACCES      5        // Permission denied
  2994. #define ERRCODE_OSEBADF       6        // Bad file number
  2995. #define ERRCODE_OSECONTR      7        // Memory blocks destroyed
  2996. #define ERRCODE_OSENOMEM      8        // Not enough core
  2997. #define ERRCODE_OSEINVMEM     9        // Invalid memory block address
  2998. #define ERRCODE_OSEINVENV     10       // 0x0a Invalid environment
  2999. #define ERRCODE_OSEINVFMT     11       // 0x0b Invalid format
  3000. #define ERRCODE_OSEINVACC     12       // 0x0c Invalid access code
  3001. #define ERRCODE_OSEINVDAT     13       // 0x0d Invalid data
  3002. #define ERRCODE_OSENODEV      15       // 0x0f No such device
  3003. #define ERRCODE_OSECURDIR     16       // 0x10 Attempt to remove curdir
  3004. #define ERRCODE_OSENOTSAM     17       // 0x11 Not same device
  3005. #define ERRCODE_OSENMFILE     18       // 0x12 No more files
  3006. #define ERRCODE_OSEINVAL      19       // 0x13 Invalid argument
  3007. #define ERRCODE_OSE2BIG       20       // 0x14 Arg list too long
  3008. #define ERRCODE_OSENOEXEC     21       // 0x15 Exec format error
  3009. #define ERRCODE_OSEXDEV       22       // 0x16 Cross-device link
  3010. #define ERRCODE_OSEDOM        33       // 0x21 Math argument
  3011. #define ERRCODE_OSERANGE      34       // 0x22 Result to large
  3012. #define ERRCODE_OSEEXIST      35       // 0x23 File already exists
  3013. #define ERRCODE_OSUNKNOWN     39       // 0x27 Unkown | illegal error from rtl 
  3014.  
  3015. #define ERRCODE_OSSHAREVIOL   50       // 0x32 Share viol, ext. err 0x20
  3016. #define ERRCODE_OSLOCKVIOL    51       // 0x33 Lock viol, ext. err 0x21
  3017. #define ERRCODE_OSINT24FAIL   52       // 0x34 INT24 called
  3018. #define ERRCODE_OSDRIVENOTREADY   53   // 0x35 Drive not ready
  3019.  
  3020.  
  3021.  
  3022. // OTHER Os errors:
  3023. // 1. odapi errors
  3024. // 2. errors from non-dos systems ( i.e. NOVELL )
  3025.  
  3026. #define ERRCODE_NOTEXACT          100       // 0x64 Not exact read/write
  3027. #define ERRCODE_OSNETERR          101       // 0x65 Generic network error 
  3028. #define ERRCODE_OSUNKNOWNSRVERR   102       // 0x66 Error from file server
  3029. #define ERRCODE_SERVERNOMEMORY    103       // 0x67 Server out of memory
  3030. #define ERRCODE_OSALREADYLOCKED   104       // 0x68 Record already locked (by you)
  3031. #define ERRCODE_OSNOTLOCKED       105       // 0x69 Record not locked
  3032. #define ERRCODE_NOSERVERSW        106       // 0x6a Server software not running the workstation/server
  3033.  
  3034.  
  3035.  
  3036. #define   DBIERR_OSEINVFNC       ( ERRBASE_OS + ERRCODE_OSEINVFNC )
  3037. #define   DBIERR_OSENOENT        ( ERRBASE_OS + ERRCODE_OSENOENT )
  3038. #define   DBIERR_OSENOPATH       ( ERRBASE_OS + ERRCODE_OSENOPATH )
  3039. #define   DBIERR_OSEMFILE        ( ERRBASE_OS + ERRCODE_OSEMFILE )
  3040. #define   DBIERR_OSEACCES        ( ERRBASE_OS + ERRCODE_OSEACCES )
  3041. #define   DBIERR_OSEBADF         ( ERRBASE_OS + ERRCODE_OSEBADF )
  3042. #define   DBIERR_OSECONTR        ( ERRBASE_OS + ERRCODE_OSECONTR )
  3043. #define   DBIERR_OSENOMEM        ( ERRBASE_OS + ERRCODE_OSENOMEM )
  3044. #define   DBIERR_OSEINVMEM       ( ERRBASE_OS + ERRCODE_OSEINVMEM )
  3045. #define   DBIERR_OSEINVENV       ( ERRBASE_OS + ERRCODE_OSEINVENV )
  3046. #define   DBIERR_OSEINVFMT       ( ERRBASE_OS + ERRCODE_OSEINVFMT )
  3047. #define   DBIERR_OSEINVACC       ( ERRBASE_OS + ERRCODE_OSEINVACC )
  3048. #define   DBIERR_OSEINVDAT       ( ERRBASE_OS + ERRCODE_OSEINVDAT )
  3049. #define   DBIERR_OSENODEV        ( ERRBASE_OS + ERRCODE_OSENODEV )
  3050. #define   DBIERR_OSECURDIR       ( ERRBASE_OS + ERRCODE_OSECURDIR )
  3051. #define   DBIERR_OSENOTSAM       ( ERRBASE_OS + ERRCODE_OSENOTSAM )
  3052. #define   DBIERR_OSENMFILE       ( ERRBASE_OS + ERRCODE_OSENMFILE )
  3053. #define   DBIERR_OSEINVAL        ( ERRBASE_OS + ERRCODE_OSEINVAL )
  3054. #define   DBIERR_OSE2BIG         ( ERRBASE_OS + ERRCODE_OSE2BIG )
  3055. #define   DBIERR_OSENOEXEC       ( ERRBASE_OS + ERRCODE_OSENOEXEC )
  3056. #define   DBIERR_OSEXDEV         ( ERRBASE_OS + ERRCODE_OSEXDEV )
  3057. #define   DBIERR_OSEDOM          ( ERRBASE_OS + ERRCODE_OSEDOM )
  3058. #define   DBIERR_OSERANGE        ( ERRBASE_OS + ERRCODE_OSERANGE )
  3059. #define   DBIERR_OSEEXIST        ( ERRBASE_OS + ERRCODE_OSEEXIST )
  3060. #define   DBIERR_OSUNKNOWN       ( ERRBASE_OS + ERRCODE_OSUNKNOWN )
  3061. #define   DBIERR_OSSHAREVIOL     ( ERRBASE_OS + ERRCODE_OSSHAREVIOL )
  3062. #define   DBIERR_OSLOCKVIOL      ( ERRBASE_OS + ERRCODE_OSLOCKVIOL )
  3063. #define   DBIERR_OSNETERR        ( ERRBASE_OS + ERRCODE_OSNETERR )
  3064. #define   DBIERR_OSINT24FAIL     ( ERRBASE_OS + ERRCODE_OSINT24FAIL )
  3065. #define   DBIERR_OSDRIVENOTREADY ( ERRBASE_OS + ERRCODE_OSDRIVENOTREADY )
  3066.  
  3067.  
  3068. #define   DBIERR_NOTEXACT        ( ERRBASE_OS + ERRCODE_NOTEXACT )
  3069. #define   DBIERR_OSUNKNOWNSRVERR ( ERRBASE_OS + ERRCODE_OSUNKNOWNSRVERR )
  3070. #define   DBIERR_SERVERNOMEMORY  ( ERRBASE_OS + ERRCODE_SERVERNOMEMORY )
  3071. #define   DBIERR_OSALREADYLOCKED ( ERRBASE_OS + ERRCODE_OSALREADYLOCKED )
  3072. #define   DBIERR_OSNOTLOCKED     ( ERRBASE_OS + ERRCODE_OSNOTLOCKED )
  3073. #define   DBIERR_NOSERVERSW      ( ERRBASE_OS + ERRCODE_NOSERVERSW)
  3074.  
  3075. // ERRCAT_NETWORK
  3076. // ==============
  3077.  
  3078. #define ERRCODE_NETINITERR       1        // Net init failed
  3079. #define ERRCODE_NETUSERLIMIT     2        // Net user limit exceeded
  3080. #define ERRCODE_NETFILEVERSION   3        // Wrong net file version
  3081. #define ERRCODE_NETFILELOCKED    4        // Not able to lock net file
  3082. #define ERRCODE_DIRNOTPRIVATE    5        // 
  3083. #define ERRCODE_NETMULTIPLE      6        // Multiple net files in use
  3084. #define ERRCODE_NETUNKNOWN       7        // Unknown net error
  3085. #define ERRCODE_SHAREDFILE       8        // Cannot access a shared file
  3086. #define ERRCODE_SHARENOTLOADED   9        // Share not loaded
  3087. #define ERRCODE_NOTONANETWORK    10       // 0x0a Not an Network
  3088. #define ERRCODE_SQLCOMMLOST      11       // 0x0b Lost Communication with SQL server
  3089. #define ERRCODE_SERVERCOMMLOST   12       // 0x0c Lost Communication with IDAPI server
  3090. #define ERRCODE_SQLSERVERNOTFOUND 13      // 0x0d SQL Server not found
  3091. #define ERRCODE_SERVERNOTFOUND   14       // 0x0e SQL Server not found
  3092.  
  3093. #define DBIERR_NETINITERR        (ERRBASE_NETWORK + ERRCODE_NETINITERR)
  3094. #define DBIERR_NETUSERLIMIT      (ERRBASE_NETWORK + ERRCODE_NETUSERLIMIT)
  3095. #define DBIERR_NETFILEVERSION    (ERRBASE_NETWORK + ERRCODE_NETFILEVERSION)
  3096. #define DBIERR_NETFILELOCKED     (ERRBASE_NETWORK + ERRCODE_NETFILELOCKED)
  3097. #define DBIERR_DIRNOTPRIVATE     (ERRBASE_NETWORK + ERRCODE_DIRNOTPRIVATE)
  3098. #define DBIERR_NETMULTIPLE       (ERRBASE_NETWORK + ERRCODE_NETMULTIPLE)
  3099. #define DBIERR_NETUNKNOWN        (ERRBASE_NETWORK + ERRCODE_NETUNKNOWN)
  3100. #define DBIERR_SHAREDFILE        (ERRBASE_NETWORK + ERRCODE_SHAREDFILE)
  3101. #define DBIERR_SHARENOTLOADED    (ERRBASE_NETWORK + ERRCODE_SHARENOTLOADED)
  3102. #define DBIERR_NOTONANETWORK     (ERRBASE_NETWORK + ERRCODE_NOTONANETWORK)
  3103. #define DBIERR_SQLCOMMLOST       (ERRBASE_NETWORK + ERRCODE_SQLCOMMLOST)
  3104. #define DBIERR_SERVERCOMMLOST    (ERRBASE_NETWORK + ERRCODE_SERVERCOMMLOST)
  3105. #define DBIERR_SQLSERVERNOTFOUND (ERRBASE_NETWORK + ERRCODE_SQLSERVERNOTFOUND)
  3106. #define DBIERR_SERVERNOTFOUND    (ERRBASE_NETWORK + ERRCODE_SERVERNOTFOUND)
  3107.  
  3108. // ERRCAT_DRIVER
  3109. // =============
  3110.  
  3111. #define ERRCODE_WRONGDRVNAME    1       // Wrong driver name
  3112. #define ERRCODE_WRONGSYSVER     2       // Wrong system version
  3113. #define ERRCODE_WRONGDRVVER     3       // Wrong driver version
  3114. #define ERRCODE_WRONGDRVTYPE    4       // Wrong driver type
  3115. #define ERRCODE_CANNOTLOADDRV   5       // Can not load driver
  3116. #define ERRCODE_CANNOTLOADLDDRV   6     // Can not load language driver
  3117. #define ERRCODE_VENDINITFAIL    7       // Vendor init failure
  3118.  
  3119.  
  3120. #define DBIERR_WRONGDRVNAME     (ERRBASE_DRIVER + ERRCODE_WRONGDRVNAME)
  3121. #define DBIERR_WRONGSYSVER      (ERRBASE_DRIVER + ERRCODE_WRONGSYSVER)
  3122. #define DBIERR_WRONGDRVVER      (ERRBASE_DRIVER + ERRCODE_WRONGDRVVER)
  3123. #define DBIERR_WRONGDRVTYPE     (ERRBASE_DRIVER + ERRCODE_WRONGDRVTYPE)
  3124. #define DBIERR_CANNOTLOADDRV    (ERRBASE_DRIVER + ERRCODE_CANNOTLOADDRV)
  3125. #define DBIERR_CANNOTLOADLDDRV  (ERRBASE_DRIVER + ERRCODE_CANNOTLOADLDDRV)
  3126. #define DBIERR_VENDINITFAIL     (ERRBASE_DRIVER + ERRCODE_VENDINITFAIL)
  3127.  
  3128.  
  3129. // ERRCAT_QUERY
  3130. // ============
  3131.  
  3132.  
  3133.  
  3134. #define DBICODE_AMBJOASY       1 // obsolete
  3135. #define DBICODE_AMBJOSYM       2 // obsolete
  3136. #define DBICODE_AMBOUTEX       3
  3137. #define DBICODE_AMBOUTPR       4 // obsolete
  3138. #define DBICODE_AMBSYMAS       5 // obsolete
  3139. #define DBICODE_ASETOPER       6
  3140. #define DBICODE_AVENUMDA       7
  3141. #define DBICODE_BADEXPR1       8
  3142. #define DBICODE_BADFLDOR       9
  3143. #define DBICODE_BADVNAME      10                              // 0x0a
  3144. #define DBICODE_BITMAPER      11                              // 0x0b
  3145. #define DBICODE_CALCBADR      12                              // 0x0c
  3146. #define DBICODE_CALCTYPE      13                              // 0x0d
  3147. #define DBICODE_CHGTO1TI      14                              // 0x0e
  3148. #define DBICODE_CHGTOCHG      15                              // 0x0f
  3149. #define DBICODE_CHGTOEXP      16                              // 0x10
  3150. #define DBICODE_CHGTOINS      17                              // 0x11
  3151. #define DBICODE_CHGTONEW      18                              // 0x12
  3152. #define DBICODE_CHGTOVAL      19                              // 0x13
  3153. #define DBICODE_CHKMRKFI      20                              // 0x14
  3154. #define DBICODE_CHNAMBIG      21                              // 0x15
  3155. #define DBICODE_CHUNKERR      22                              // 0x16
  3156. #define DBICODE_COLUM255      23                              // 0x17
  3157. #define DBICODE_CONAFTAS      24                              // 0x18
  3158. #define DBICODE_DEL1TIME      25                              // 0x19
  3159. #define DBICODE_DELAMBIG      26                              // 0x1a
  3160. #define DBICODE_DELFRDEL      27                              // 0x1b
  3161. #define DBICODE_EGFLDTYP      28                              // 0x1c
  3162. #define DBICODE_EXAMINOR      29                              // 0x1d
  3163. #define DBICODE_EXPRTYPS      30                              // 0x1e
  3164. #define DBICODE_EXTRACOM      31                              // 0x1f
  3165. #define DBICODE_EXTRAORO      32                              // 0x20
  3166. #define DBICODE_EXTRAQRO      33                              // 0x21
  3167. #define DBICODE_FIND1ATT      34                              // 0x22
  3168. #define DBICODE_FINDANST      35                              // 0x23
  3169. #define DBICODE_GRPNOSET      36                              // 0x24
  3170. #define DBICODE_GRPSTROW      37                              // 0x25
  3171. #define DBICODE_IDFINLCO      38                              // 0x26
  3172. #define DBICODE_IDFPERLI      39                              // 0x27
  3173. #define DBICODE_INANEXPR      40                              // 0x28
  3174. #define DBICODE_INS1TIME      41                              // 0x29
  3175. #define DBICODE_INSAMBIG      42                              // 0x2a
  3176. #define DBICODE_INSDELCH      43                              // 0x2b
  3177. #define DBICODE_INSEXPRR      44                              // 0x2c
  3178. #define DBICODE_INSTOINS      45                              // 0x2d
  3179. #define DBICODE_ISARRAY       46                              // 0x2e
  3180. #define DBICODE_LABELERR      47                              // 0x2f
  3181. #define DBICODE_LINKCALC      48                              // 0x30
  3182. #define DBICODE_LNGVNAME      49                              // 0x31
  3183. #define DBICODE_LONGQURY      50                              // 0x32
  3184. #define DBICODE_MEMVPROC      51                              // 0x33
  3185. #define DBICODE_MISNGCOM      52                              // 0x34
  3186. #define DBICODE_MISNGRPA      53                              // 0x35
  3187. #define DBICODE_MISSRTQU      54                              // 0x36
  3188. #define DBICODE_NAMTWICE      55                              // 0x37
  3189. #define DBICODE_NOCHKMAR      56                              // 0x38
  3190. #define DBICODE_NODEFOCC      57                              // 0x39
  3191. #define DBICODE_NOGROUPS      58                              // 0x3a
  3192. #define DBICODE_NONSENSE      59                              // 0x3b
  3193. #define DBICODE_NOPATTER      60                              // 0x3c
  3194. #define DBICODE_NOSUCHDA      61                              // 0x3d
  3195. #define DBICODE_NOVALUE       62                              // 0x3e
  3196. #define DBICODE_ONLYCONS      63                              // 0x3f
  3197. #define DBICODE_ONLYSETR      64                              // 0x40
  3198. #define DBICODE_OUTSENS1      65                              // 0x41
  3199. #define DBICODE_OUTTWIC1      66                              // 0x42
  3200. #define DBICODE_PAROWCNT      67                              // 0x43
  3201. #define DBICODE_PERSEPAR      68                              // 0x44
  3202. #define DBICODE_PROCPLSW      69                              // 0x45
  3203. #define DBICODE_PWINSRTS      70                              // 0x46
  3204. #define DBICODE_PWMODRTS      71                              // 0x47
  3205. #define DBICODE_QBEFLDFOUND   72                              // 0x48
  3206. #define DBICODE_QBENOFENCE    73                              // 0x49
  3207. #define DBICODE_QBENOFENCET   74                              // 0x4a
  3208. #define DBICODE_QBENOHEADERT  75                              // 0x4b
  3209. #define DBICODE_QBENOTAB      76                              // 0x4c
  3210. #define DBICODE_QBENUMCOLS    77                              // 0x4d
  3211. #define DBICODE_QBEOPENTAB    78                              // 0x4e
  3212. #define DBICODE_QBETWICE      79                              // 0x4f
  3213. #define DBICODE_QRYNOANSWER   80                              // 0x50
  3214. #define DBICODE_QRYNOTPREP    81                              // 0x51
  3215. #define DBICODE_QUAINDEL      82                              // 0x52
  3216. #define DBICODE_QUAININS      83                              // 0x53
  3217. #define DBICODE_RAGININS      84                              // 0x54
  3218. #define DBICODE_RAGINSET      85                              // 0x55
  3219. #define DBICODE_ROWUSERR      86                              // 0x56
  3220. #define DBICODE_SETEXPEC      87                              // 0x57
  3221. #define DBICODE_SETVAMB1      88                              // 0x58
  3222. #define DBICODE_SETVBAD1      89                              // 0x59
  3223. #define DBICODE_SETVDEF1      90                              // 0x5a
  3224. #define DBICODE_SUMNUMBE      91                              // 0x5b
  3225. #define DBICODE_TBLISWP3      92                              // 0x5c
  3226. #define DBICODE_TOKENNOT      93                              // 0x5d
  3227. #define DBICODE_TWOOUTR1      94                              // 0x5e
  3228. #define DBICODE_TYPEMISM      95                              // 0x5f
  3229. #define DBICODE_UNRELQ1       96                              // 0x60
  3230. #define DBICODE_UNUSEDST      97                              // 0x61
  3231. #define DBICODE_USEINSDE      98                              // 0x62
  3232. #define DBICODE_USEOFCHG      99                              // 0x63
  3233. #define DBICODE_VARMUSTF     100                              // 0x64
  3234. #define DBICODE_REGISTER     101                              // 0x65
  3235. #define DBICODE_LONGEXPR     102                              // 0x66
  3236. #define DBICODE_REFRESH      103                              // 0x67
  3237. #define DBICODE_CANCEXCEPT   104                              // 0x68
  3238. #define DBICODE_DBEXCEPT     105                              // 0x69
  3239. #define DBICODE_MEMEXCEPT    106                              // 0x6a
  3240. #define DBICODE_FATALEXCEPT  107                              // 0x6b
  3241. #define DBICODE_QRYNIY       108                              // 0x6c
  3242. #define DBICODE_BADFORMAT    109                              // 0x6d
  3243. #define DBICODE_QRYEMPTY     110                              // 0x6e
  3244. #define DBICODE_NOQRYTOPREP  111                              // 0x6f
  3245. #define DBICODE_BUFFTOOSMALL 112                              // 0x70
  3246. #define DBICODE_QRYNOTPARSE  113                              // 0x71
  3247. #define DBICODE_NOTHANDLE    114                              // 0x72
  3248. #define DBICODE_QRYSYNTERR   115                              // 0x73
  3249. #define DBICODE_QXFLDCOUNT   116                              // 0x74
  3250. #define DBICODE_QXFLDSYMNOTFOUND 117                          // 0x75
  3251. #define DBICODE_QXTBLSYMNOTFOUND 118                          // 0x76
  3252. #define DBICODE_BLOBTERM     119                              // 0x77
  3253. #define DBICODE_BLOBERR      120                              // 0x78
  3254. #define DBICODE_RESTARTQRY   121                              // 0x79
  3255. #define DBICODE_UNKNOWNANSTYPE 122                            // 0x7a
  3256.  
  3257. // Internal QBE use Only.
  3258.    #define DBICODE_SQLG_MDIST 123                           // 0x7b
  3259.    #define DBICODE_SQLG_NOARI 124                           // 0x7c
  3260.    #define DBICODE_SQLG_LIKEN 125                           // 0x7d
  3261.    #define DBICODE_SQLG_ALPHO 126                           // 0x7e
  3262.    #define DBICODE_SQLG_DATEO 127                           // 0x7f
  3263.    #define DBICODE_SQLG_RELOP 128                           // 0x80
  3264.    #define DBICODE_SQLG_ONLYC 129                           // 0x81
  3265.    #define DBICODE_SQLG_CNTLN 130                           // 0x82
  3266.    #define DBICODE_SQLG_CHINI 131                           // 0x83
  3267.    #define DBICODE_SQLG_UNION 132                           // 0x84
  3268.    #define DBICODE_SQLG_SLFIN 133                           // 0x85
  3269.    #define DBICODE_SQLG_OTJVR 134                           // 0x86
  3270.    #define DBICODE_SQLG_STROW 135                           // 0x87
  3271.    #define DBICODE_SQLG_QUANT 136                           // 0x88
  3272.    #define DBICODE_SQLG_REGSO 137                           // 0x89
  3273.    #define DBICODE_SQLG_COUNT 138                           // 0x8a
  3274.    #define DBICODE_SQLG_AVERA 139                           // 0x8b
  3275.    #define DBICODE_SQLG_DATEA 140                           // 0x8c
  3276.    #define DBICODE_SQLG_BADPT 141                           // 0x8d
  3277.    #define DBICODE_SQLG_RELPA 142                           // 0x8e
  3278.    #define DBICODE_SQLG_PATRN 143                           // 0x8f
  3279.    #define DBICODE_SQLG_FNDSU 144                           // 0x90
  3280.    #define DBICODE_SQLG_IFDCS 145                           // 0x91
  3281.    #define DBICODE_SQLG_IDCCO 146                           // 0x92
  3282.    #define DBICODE_SQLG_ONLYI 147                           // 0x93
  3283.    #define DBICODE_SQLG_SQLDIALECT 148                      // 0x94
  3284.    #define DBICODE_SQLG_NOQUERY 149                         // 0x95
  3285. // End of Internal.
  3286.  
  3287. #define DBICODE_BLOBGROUP 150                               // 0x96
  3288. #define DBICODE_QRYNOPROP  151                              // 0x97
  3289. #define DBICODE_ANSTYPNOTSUP  152                           // 0x98
  3290. #define DBICODE_ANSALIASNOTSUP  153                         // 0x99
  3291. #define DBICODE_INSBLOBREQ      154                         // 0x9a
  3292. #define DBICODE_CHGUNIQUENDXREQ 155                         // 0x9b
  3293. #define DBICODE_DELUNIQUENDXREQ 156                         // 0x9c
  3294. #define DBICODE_SQLNOFULLUPDATE 157                         // 0x9d
  3295. #define DBICODE_CANTEXECREMOTE  158                         // 0x9e
  3296. #define DBICODE_UNEXPECTEDEOC   159                         // 0x9f
  3297. #define DBICODE_SQLPARAMNOTSET  160                         // 0xA0
  3298. #define DBICODE_QUERYTOOLONG    161                         // 0xA1
  3299.  
  3300.  
  3301. #define DBIERR_AMBJOASY    (ERRBASE_QUERY+DBICODE_AMBJOASY)
  3302. #define DBIERR_AMBJOSYM    (ERRBASE_QUERY+DBICODE_AMBJOSYM)
  3303. #define DBIERR_AMBOUTEX    (ERRBASE_QUERY+DBICODE_AMBOUTEX)
  3304. #define DBIERR_AMBOUTPR    (ERRBASE_QUERY+DBICODE_AMBOUTPR)
  3305. #define DBIERR_AMBSYMAS    (ERRBASE_QUERY+DBICODE_AMBSYMAS)
  3306. #define DBIERR_ASETOPER    (ERRBASE_QUERY+DBICODE_ASETOPER)
  3307. #define DBIERR_AVENUMDA    (ERRBASE_QUERY+DBICODE_AVENUMDA)
  3308. #define DBIERR_BADEXPR1    (ERRBASE_QUERY+DBICODE_BADEXPR1)
  3309. #define DBIERR_BADFLDOR    (ERRBASE_QUERY+DBICODE_BADFLDOR)
  3310. #define DBIERR_BADVNAME    (ERRBASE_QUERY+DBICODE_BADVNAME)
  3311. #define DBIERR_BITMAPER    (ERRBASE_QUERY+DBICODE_BITMAPER)
  3312. #define DBIERR_CALCBADR    (ERRBASE_QUERY+DBICODE_CALCBADR)
  3313. #define DBIERR_CALCTYPE    (ERRBASE_QUERY+DBICODE_CALCTYPE)
  3314. #define DBIERR_CHGTO1TI    (ERRBASE_QUERY+DBICODE_CHGTO1TI)
  3315. #define DBIERR_CHGTOCHG    (ERRBASE_QUERY+DBICODE_CHGTOCHG)
  3316. #define DBIERR_CHGTOEXP    (ERRBASE_QUERY+DBICODE_CHGTOEXP)
  3317. #define DBIERR_CHGTOINS    (ERRBASE_QUERY+DBICODE_CHGTOINS)
  3318. #define DBIERR_CHGTONEW    (ERRBASE_QUERY+DBICODE_CHGTONEW)
  3319. #define DBIERR_CHGTOVAL    (ERRBASE_QUERY+DBICODE_CHGTOVAL)
  3320. #define DBIERR_CHKMRKFI    (ERRBASE_QUERY+DBICODE_CHKMRKFI)
  3321. #define DBIERR_CHNAMBIG    (ERRBASE_QUERY+DBICODE_CHNAMBIG)
  3322. #define DBIERR_CHUNKERR    (ERRBASE_QUERY+DBICODE_CHUNKERR)
  3323. #define DBIERR_COLUM255    (ERRBASE_QUERY+DBICODE_COLUM255)
  3324. #define DBIERR_CONAFTAS    (ERRBASE_QUERY+DBICODE_CONAFTAS)
  3325. #define DBIERR_DEL1TIME    (ERRBASE_QUERY+DBICODE_DEL1TIME)
  3326. #define DBIERR_DELAMBIG    (ERRBASE_QUERY+DBICODE_DELAMBIG)
  3327. #define DBIERR_DELFRDEL    (ERRBASE_QUERY+DBICODE_DELFRDEL)
  3328. #define DBIERR_EGFLDTYP    (ERRBASE_QUERY+DBICODE_EGFLDTYP)
  3329. #define DBIERR_EXAMINOR    (ERRBASE_QUERY+DBICODE_EXAMINOR)
  3330. #define DBIERR_EXPRTYPS    (ERRBASE_QUERY+DBICODE_EXPRTYPS)
  3331. #define DBIERR_EXTRACOM    (ERRBASE_QUERY+DBICODE_EXTRACOM)
  3332. #define DBIERR_EXTRAORO    (ERRBASE_QUERY+DBICODE_EXTRAORO)
  3333. #define DBIERR_EXTRAQRO    (ERRBASE_QUERY+DBICODE_EXTRAQRO)
  3334. #define DBIERR_FIND1ATT    (ERRBASE_QUERY+DBICODE_FIND1ATT)
  3335. #define DBIERR_FINDANST    (ERRBASE_QUERY+DBICODE_FINDANST)
  3336. #define DBIERR_GRPNOSET    (ERRBASE_QUERY+DBICODE_GRPNOSET)
  3337. #define DBIERR_GRPSTROW    (ERRBASE_QUERY+DBICODE_GRPSTROW)
  3338. #define DBIERR_IDFINLCO    (ERRBASE_QUERY+DBICODE_IDFINLCO)
  3339. #define DBIERR_IDFPERLI    (ERRBASE_QUERY+DBICODE_IDFPERLI)
  3340. #define DBIERR_INANEXPR    (ERRBASE_QUERY+DBICODE_INANEXPR)
  3341. #define DBIERR_INS1TIME    (ERRBASE_QUERY+DBICODE_INS1TIME)
  3342. #define DBIERR_INSAMBIG    (ERRBASE_QUERY+DBICODE_INSAMBIG)
  3343. #define DBIERR_INSDELCH    (ERRBASE_QUERY+DBICODE_INSDELCH)
  3344. #define DBIERR_INSEXPRR    (ERRBASE_QUERY+DBICODE_INSEXPRR)
  3345. #define DBIERR_INSTOINS    (ERRBASE_QUERY+DBICODE_INSTOINS)
  3346. #define DBIERR_ISARRAY     (ERRBASE_QUERY+DBICODE_ISARRAY)
  3347. #define DBIERR_LABELERR    (ERRBASE_QUERY+DBICODE_LABELERR)
  3348. #define DBIERR_LINKCALC    (ERRBASE_QUERY+DBICODE_LINKCALC)
  3349. #define DBIERR_LNGVNAME    (ERRBASE_QUERY+DBICODE_LNGVNAME)
  3350. #define DBIERR_LONGQURY    (ERRBASE_QUERY+DBICODE_LONGQURY)
  3351. #define DBIERR_MEMVPROC    (ERRBASE_QUERY+DBICODE_MEMVPROC)
  3352. #define DBIERR_MISNGCOM    (ERRBASE_QUERY+DBICODE_MISNGCOM)
  3353. #define DBIERR_MISNGRPA    (ERRBASE_QUERY+DBICODE_MISNGRPA)
  3354. #define DBIERR_MISSRTQU    (ERRBASE_QUERY+DBICODE_MISSRTQU)
  3355. #define DBIERR_NAMTWICE    (ERRBASE_QUERY+DBICODE_NAMTWICE)
  3356. #define DBIERR_NOCHKMAR    (ERRBASE_QUERY+DBICODE_NOCHKMAR)
  3357. #define DBIERR_NODEFOCC    (ERRBASE_QUERY+DBICODE_NODEFOCC)
  3358. #define DBIERR_NOGROUPS    (ERRBASE_QUERY+DBICODE_NOGROUPS)
  3359. #define DBIERR_NONSENSE    (ERRBASE_QUERY+DBICODE_NONSENSE)
  3360. #define DBIERR_NOPATTER    (ERRBASE_QUERY+DBICODE_NOPATTER)
  3361. #define DBIERR_NOSUCHDA    (ERRBASE_QUERY+DBICODE_NOSUCHDA)
  3362. #define DBIERR_NOVALUE     (ERRBASE_QUERY+DBICODE_NOVALUE)
  3363. #define DBIERR_ONLYCONS    (ERRBASE_QUERY+DBICODE_ONLYCONS)
  3364. #define DBIERR_ONLYSETR    (ERRBASE_QUERY+DBICODE_ONLYSETR)
  3365. #define DBIERR_OUTSENS1    (ERRBASE_QUERY+DBICODE_OUTSENS1)
  3366. #define DBIERR_OUTTWIC1    (ERRBASE_QUERY+DBICODE_OUTTWIC1)
  3367. #define DBIERR_PAROWCNT    (ERRBASE_QUERY+DBICODE_PAROWCNT)
  3368. #define DBIERR_PERSEPAR    (ERRBASE_QUERY+DBICODE_PERSEPAR)
  3369. #define DBIERR_PROCPLSW    (ERRBASE_QUERY+DBICODE_PROCPLSW)
  3370. #define DBIERR_PWINSRTS    (ERRBASE_QUERY+DBICODE_PWINSRTS)
  3371. #define DBIERR_PWMODRTS    (ERRBASE_QUERY+DBICODE_PWMODRTS)
  3372. #define DBIERR_QBEFLDFOUND (ERRBASE_QUERY+DBICODE_QBEFLDFOUND)
  3373. #define DBIERR_QBENOFENCE  (ERRBASE_QUERY+DBICODE_QBENOFENCE)
  3374. #define DBIERR_QBENOFENCET (ERRBASE_QUERY+DBICODE_QBENOFENCET)
  3375. #define DBIERR_QBENOHEADERT (ERRBASE_QUERY+DBICODE_QBENOHEADERT)
  3376. #define DBIERR_QBENOTAB    (ERRBASE_QUERY+DBICODE_QBENOTAB)
  3377. #define DBIERR_QBENUMCOLS  (ERRBASE_QUERY+DBICODE_QBENUMCOLS)
  3378. #define DBIERR_QBEOPENTAB  (ERRBASE_QUERY+DBICODE_QBEOPENTAB)
  3379. #define DBIERR_QBETWICE    (ERRBASE_QUERY+DBICODE_QBETWICE)
  3380. #define DBIERR_QRYNOANSWER (ERRBASE_QUERY+DBICODE_QRYNOANSWER)
  3381. #define DBIERR_QRYNOTPREP  (ERRBASE_QUERY+DBICODE_QRYNOTPREP)
  3382. #define DBIERR_QUAINDEL    (ERRBASE_QUERY+DBICODE_QUAINDEL)
  3383. #define DBIERR_QUAININS    (ERRBASE_QUERY+DBICODE_QUAININS)
  3384. #define DBIERR_RAGININS    (ERRBASE_QUERY+DBICODE_RAGININS)
  3385. #define DBIERR_RAGINSET    (ERRBASE_QUERY+DBICODE_RAGINSET)
  3386. #define DBIERR_ROWUSERR    (ERRBASE_QUERY+DBICODE_ROWUSERR)
  3387. #define DBIERR_SETEXPEC    (ERRBASE_QUERY+DBICODE_SETEXPEC)
  3388. #define DBIERR_SETVAMB1    (ERRBASE_QUERY+DBICODE_SETVAMB1)
  3389. #define DBIERR_SETVBAD1    (ERRBASE_QUERY+DBICODE_SETVBAD1)
  3390. #define DBIERR_SETVDEF1    (ERRBASE_QUERY+DBICODE_SETVDEF1)
  3391. #define DBIERR_SUMNUMBE    (ERRBASE_QUERY+DBICODE_SUMNUMBE)
  3392. #define DBIERR_TBLISWP3    (ERRBASE_QUERY+DBICODE_TBLISWP3)
  3393. #define DBIERR_TOKENNOT    (ERRBASE_QUERY+DBICODE_TOKENNOT)
  3394. #define DBIERR_TWOOUTR1    (ERRBASE_QUERY+DBICODE_TWOOUTR1)
  3395. #define DBIERR_TYPEMISM    (ERRBASE_QUERY+DBICODE_TYPEMISM)
  3396. #define DBIERR_UNRELQ1     (ERRBASE_QUERY+DBICODE_UNRELQ1)
  3397. #define DBIERR_UNUSEDST    (ERRBASE_QUERY+DBICODE_UNUSEDST)
  3398. #define DBIERR_USEINSDE    (ERRBASE_QUERY+DBICODE_USEINSDE)
  3399. #define DBIERR_USEOFCHG    (ERRBASE_QUERY+DBICODE_USEOFCHG)
  3400. #define DBIERR_VARMUSTF    (ERRBASE_QUERY+DBICODE_VARMUSTF)
  3401. #define DBIERR_REGISTER    (ERRBASE_QUERY+DBICODE_REGISTER)
  3402. #define DBIERR_LONGEXPR    (ERRBASE_QUERY+DBICODE_LONGEXPR)
  3403. #define DBIERR_REFRESH     (ERRBASE_QUERY+DBICODE_REFRESH)
  3404. #define DBIERR_CANCEXCEPT  (ERRBASE_QUERY+DBICODE_CANCEXCEPT)
  3405. #define DBIERR_DBEXCEPT    (ERRBASE_QUERY+DBICODE_DBEXCEPT)
  3406. #define DBIERR_MEMEXCEPT   (ERRBASE_QUERY+DBICODE_MEMEXCEPT)
  3407. #define DBIERR_FATALEXCEPT (ERRBASE_QUERY+DBICODE_FATALEXCEPT)
  3408. #define DBIERR_QRYNIY      (ERRBASE_QUERY+ DBICODE_QRYNIY)
  3409. #define DBIERR_BADFORMAT   (ERRBASE_QUERY+ DBICODE_BADFORMAT)
  3410. #define DBIERR_QRYEMPTY    (ERRBASE_QUERY+ DBICODE_QRYEMPTY)
  3411. #define DBIERR_NOQRYTOPREP (ERRBASE_QUERY+ DBICODE_NOQRYTOPREP)
  3412. #define DBIERR_BUFFTOOSMALL (ERRBASE_QUERY+ DBICODE_BUFFTOOSMALL)
  3413. #define DBIERR_QRYNOTPARSE (ERRBASE_QUERY+ DBICODE_QRYNOTPARSE)
  3414. #define DBIERR_NOTHANDLE   (ERRBASE_QUERY+ DBICODE_NOTHANDLE)
  3415. #define DBIERR_QRYSYNTERR  (ERRBASE_QUERY+ DBICODE_QRYSYNTERR)
  3416. #define DBIERR_QXFLDCOUNT  (ERRBASE_QUERY+ DBICODE_QXFLDCOUNT)
  3417. #define DBIERR_QXFLDSYMNOTFOUND (ERRBASE_QUERY+ DBICODE_QXFLDSYMNOTFOUND)
  3418. #define DBIERR_QXTBLSYMNOTFOUND (ERRBASE_QUERY+ DBICODE_QXTBLSYMNOTFOUND)
  3419. #define DBIERR_BLOBTERM    (ERRBASE_QUERY+ DBICODE_BLOBTERM)
  3420. #define DBIERR_BLOBERR     (ERRBASE_QUERY+ DBICODE_BLOBERR)
  3421. #define DBIERR_RESTARTQRY  (ERRBASE_QUERY+ DBICODE_RESTARTQRY)
  3422. #define DBIERR_UNKNOWNANSTYPE (ERRBASE_QUERY+ DBICODE_UNKNOWNANSTYPE)
  3423. #define DBIERR_SQLG_MDIST  (ERRBASE_QUERY+ DBICODE_SQLG_MDIST)
  3424. #define DBIERR_SQLG_NOARI  (ERRBASE_QUERY+ DBICODE_SQLG_NOARI)
  3425. #define DBIERR_SQLG_LIKEN  (ERRBASE_QUERY+ DBICODE_SQLG_LIKEN)
  3426. #define DBIERR_SQLG_ALPHO  (ERRBASE_QUERY+ DBICODE_SQLG_ALPHO)
  3427. #define DBIERR_SQLG_DATEO  (ERRBASE_QUERY+ DBICODE_SQLG_DATEO)
  3428. #define DBIERR_SQLG_RELOP  (ERRBASE_QUERY+ DBICODE_SQLG_RELOP)
  3429. #define DBIERR_SQLG_ONLYC  (ERRBASE_QUERY+ DBICODE_SQLG_ONLYC)
  3430. #define DBIERR_SQLG_CNTLN  (ERRBASE_QUERY+ DBICODE_SQLG_CNTLN)
  3431. #define DBIERR_SQLG_CHINI  (ERRBASE_QUERY+ DBICODE_SQLG_CHINI)
  3432. #define DBIERR_SQLG_UNION  (ERRBASE_QUERY+ DBICODE_SQLG_UNION)
  3433. #define DBIERR_SQLG_SLFIN  (ERRBASE_QUERY+ DBICODE_SQLG_SLFIN)
  3434. #define DBIERR_SQLG_OTJVR  (ERRBASE_QUERY+ DBICODE_SQLG_OTJVR)
  3435. #define DBIERR_SQLG_STROW  (ERRBASE_QUERY+ DBICODE_SQLG_STROW)
  3436. #define DBIERR_SQLG_QUANT  (ERRBASE_QUERY+ DBICODE_SQLG_QUANT)
  3437. #define DBIERR_SQLG_REGSO  (ERRBASE_QUERY+ DBICODE_SQLG_REGSO)
  3438. #define DBIERR_SQLG_COUNT  (ERRBASE_QUERY+ DBICODE_SQLG_COUNT)
  3439. #define DBIERR_SQLG_AVERA  (ERRBASE_QUERY+ DBICODE_SQLG_AVERA)
  3440. #define DBIERR_SQLG_DATEA  (ERRBASE_QUERY+ DBICODE_SQLG_DATEA)
  3441. #define DBIERR_SQLG_BADPT  (ERRBASE_QUERY+ DBICODE_SQLG_BADPT)
  3442. #define DBIERR_SQLG_RELPA  (ERRBASE_QUERY+ DBICODE_SQLG_RELPA)
  3443. #define DBIERR_SQLG_PATRN  (ERRBASE_QUERY+ DBICODE_SQLG_PATRN)
  3444. #define DBIERR_SQLG_FNDSU  (ERRBASE_QUERY+ DBICODE_SQLG_FNDSU)
  3445. #define DBIERR_SQLG_IFDCS  (ERRBASE_QUERY+ DBICODE_SQLG_IFDCS)
  3446. #define DBIERR_SQLG_IDCCO  (ERRBASE_QUERY+ DBICODE_SQLG_IDCCO)
  3447. #define DBIERR_SQLG_ONLYI  (ERRBASE_QUERY+ DBICODE_SQLG_ONLYI)
  3448. #define DBIERR_SQLG_SQLDIALECT (ERRBASE_QUERY+ DBICODE_SQLG_SQLDIALECT)
  3449. #define DBIERR_SQLG_NOQUERY (ERRBASE_QUERY+ DBICODE_SQLG_NOQUERY)
  3450. #define DBIERR_BLOBGROUP   (ERRBASE_QUERY+ DBICODE_BLOBGROUP)
  3451. #define DBIERR_QRYNOPROP   (ERRBASE_QUERY+DBICODE_QRYNOPROP)
  3452. #define DBIERR_ANSTYPNOTSUP   (ERRBASE_QUERY+DBICODE_ANSTYPNOTSUP)
  3453. #define DBIERR_ANSALIASNOTSUP (ERRBASE_QUERY+DBICODE_ANSALIASNOTSUP)
  3454. #define DBIERR_INSBLOBREQ     (ERRBASE_QUERY+DBICODE_INSBLOBREQ     )                         // 0x9a
  3455. #define DBIERR_CHGUNIQUENDXREQ (ERRBASE_QUERY+DBICODE_CHGUNIQUENDXREQ)                         // 0x9b
  3456. #define DBIERR_DELUNIQUENDXREQ (ERRBASE_QUERY+DBICODE_DELUNIQUENDXREQ)                         // 0x9c
  3457. #define DBIERR_SQLNOFULLUPDATE (ERRBASE_QUERY+DBICODE_SQLNOFULLUPDATE)                         // 0x9d
  3458. #define DBIERR_CANTEXECREMOTE  (ERRBASE_QUERY+DBICODE_CANTEXECREMOTE)                          // 0x9e
  3459. #define DBIERR_UNEXPECTEDEOC   (ERRBASE_QUERY+DBICODE_UNEXPECTEDEOC)
  3460. #define DBIERR_SQLPARAMNOTSET  (ERRBASE_QUERY+DBICODE_SQLPARAMNOTSET)
  3461. #define DBIERR_QUERYTOOLONG    (ERRBASE_QUERY+DBICODE_QUERYTOOLONG)
  3462.  
  3463.  
  3464.  
  3465. // END_OF_QUERY_MESSAGES
  3466.  
  3467. // ERRCAT_VERSION
  3468. // ===============
  3469.  
  3470. #define  ERRCODE_INTERFACEVER    1        // Interface mismatch
  3471. #define  ERRCODE_INDEXOUTOFDATE  2        // Index is out of date
  3472. #define  ERRCODE_OLDVERSION      3        // Older version (see context)
  3473. #define  ERRCODE_VALFILEINVALID  4        // Val. file is out of date
  3474. #define  ERRCODE_BLOBVERSION     5        // Old Blob file version
  3475. #define  ERRCODE_ENGQRYMISMATCH  6        // Query and ODAPI are mismatched
  3476. #define  ERRCODE_SERVERVERSION   7        // Server is incompatible version
  3477.  
  3478. #define  DBIERR_INTERFACEVER     (ERRBASE_VERSION + ERRCODE_INTERFACEVER)
  3479. #define  DBIERR_INDEXOUTOFDATE   (ERRBASE_VERSION + ERRCODE_INDEXOUTOFDATE)
  3480. #define  DBIERR_OLDVERSION       (ERRBASE_VERSION + ERRCODE_OLDVERSION)
  3481. #define  DBIERR_VALFILEINVALID   (ERRBASE_VERSION + ERRCODE_VALFILEINVALID)
  3482. #define  DBIERR_BLOBVERSION      (ERRBASE_VERSION + ERRCODE_BLOBVERSION)
  3483. #define  DBIERR_ENGQRYMISMATCH   (ERRBASE_VERSION + ERRCODE_ENGQRYMISMATCH)
  3484. #define  DBIERR_SERVERVERSION    (ERRBASE_VERSION + ERRCODE_SERVERVERSION)
  3485.  
  3486. // ERRCAT_CAPABILITY
  3487. // =================
  3488.  
  3489. #define  ERRCODE_NOTSUPPORTED    1        // Capability not supported
  3490. #define  ERRCODE_NIY             2        // Not Implemented Yet
  3491. #define  ERRCODE_TABLESQL        3        // Cannot access SQL replica
  3492. #define  ERRCODE_SEARCHCOLREQD   4        // Searchable (Non-blob column) required
  3493. #define  ERRCODE_NOMULTCONNECT   5        // Multiple connections not supported
  3494. #define  ERRCODE_NODBASEEXPR     6        // Full dBASE Expressions not supported
  3495.  
  3496. #define  DBIERR_NOTSUPPORTED     (ERRBASE_CAPABILITY + ERRCODE_NOTSUPPORTED)
  3497. #define  DBIERR_NIY              (ERRBASE_CAPABILITY + ERRCODE_NIY)
  3498. #define  DBIERR_TABLESQL         (ERRBASE_CAPABILITY + ERRCODE_TABLESQL)
  3499. #define  DBIERR_SEARCHCOLREQD    (ERRBASE_CAPABILITY + ERRCODE_SEARCHCOLREQD)
  3500. #define  DBIERR_NOMULTCONNECT    (ERRBASE_CAPABILITY + ERRCODE_NOMULTCONNECT)
  3501. #define  DBIERR_NODBASEEXPR      (ERRBASE_CAPABILITY + ERRCODE_NODBASEEXPR)
  3502.  
  3503. // ERRCAT_CONFIG            
  3504. // =============
  3505.  
  3506. #define ERRCODE_INVALIDDBSPEC    1
  3507. #define ERRCODE_UNKNOWNDBTYPE    2
  3508. #define ERRCODE_INVALIDSYSDATA   3
  3509. #define ERRCODE_UNKNOWNNETTYPE   4
  3510. #define ERRCODE_NOTONTHATNET     5
  3511. #define ERRCODE_INVALIDCFGPARAM  6        // Generic invalid config param
  3512.  
  3513.  
  3514. #define DBIERR_INVALIDDBSPEC     (ERRBASE_CONFIG + ERRCODE_INVALIDDBSPEC)
  3515. #define DBIERR_UNKNOWNDBTYPE     (ERRBASE_CONFIG + ERRCODE_UNKNOWNDBTYPE)
  3516. #define DBIERR_INVALIDSYSDATA    (ERRBASE_CONFIG + ERRCODE_INVALIDSYSDATA)
  3517. #define DBIERR_UNKNOWNNETTYPE    (ERRBASE_CONFIG + ERRCODE_UNKNOWNNETTYPE)
  3518. #define DBIERR_NOTONTHATNET      (ERRBASE_CONFIG + ERRCODE_NOTONTHATNET)
  3519. #define DBIERR_INVALIDCFGPARAM   (ERRBASE_CONFIG + ERRCODE_INVALIDCFGPARAM)
  3520.  
  3521. // ERRCAT_WARNING  non-fatal warnings:
  3522. // warn user of action, or ask for optional behavior
  3523. // ==============
  3524. #define ERRCODE_OBJIMPLICITLYDROPPED      1
  3525. #define ERRCODE_OBJMAYBETRUNCATED         2
  3526. #define ERRCODE_OBJIMPLICITLYMODIFIED     3
  3527. #define ERRCODE_VALIDATEDATA              4
  3528. #define ERRCODE_VALFIELDMODIFIED          5
  3529. #define ERRCODE_TABLELEVELCHANGED         6
  3530. #define ERRCODE_COPYLINKEDTABLES          7
  3531. #define ERRCODE_OTHERSERVERLOADED         8
  3532. #define ERRCODE_OBJIMPLICITLYTRUNCATED    9
  3533. #define ERRCODE_VCHKMAYNOTBEENFORCED      10
  3534. #define ERRCODE_MULTIPLEUNIQRECS          11
  3535. #define ERRCODE_FIELDMUSTBETRIMMED        12
  3536.  
  3537. #define DBIERR_OBJIMPLICITLYDROPPED  \
  3538.    ( ERRBASE_WARNING + ERRCODE_OBJIMPLICITLYDROPPED)
  3539. #define DBIERR_OBJMAYBETRUNCATED (ERRBASE_WARNING + ERRCODE_OBJMAYBETRUNCATED)
  3540. #define DBIERR_OBJIMPLICITLYMODIFIED  \
  3541.    ( ERRBASE_WARNING + ERRCODE_OBJIMPLICITLYMODIFIED)
  3542. #define DBIERR_VALIDATEDATA              \
  3543.    ( ERRBASE_WARNING + ERRCODE_VALIDATEDATA)
  3544. #define DBIERR_VALFIELDMODIFIED          \
  3545.    ( ERRBASE_WARNING + ERRCODE_VALFIELDMODIFIED)
  3546. #define DBIERR_TABLELEVELCHANGED         \
  3547.    ( ERRBASE_WARNING + ERRCODE_TABLELEVELCHANGED)
  3548. #define DBIERR_COPYLINKEDTABLES          \
  3549.    ( ERRBASE_WARNING + ERRCODE_COPYLINKEDTABLES)
  3550. #define DBIERR_OTHERSERVERLOADED          \
  3551.    ( ERRBASE_WARNING + ERRCODE_OTHERSERVERLOADED)
  3552. #define DBIERR_OBJIMPLICITLYTRUNCATED  \
  3553.    ( ERRBASE_WARNING + ERRCODE_OBJIMPLICITLYTRUNCATED)
  3554. #define DBIERR_VCHKMAYNOTBEENFORCED       \
  3555.    ( ERRBASE_WARNING + ERRCODE_VCHKMAYNOTBEENFORCED )
  3556. #define DBIERR_MULTIPLEUNIQRECS    \
  3557.    ( ERRBASE_WARNING + ERRCODE_MULTIPLEUNIQRECS )
  3558. #define DBIERR_FIELDMUSTBETRIMMED        \
  3559.    ( ERRBASE_WARNING + ERRCODE_FIELDMUSTBETRIMMED )
  3560.  
  3561.  
  3562. // ERRCAT_OTHER
  3563. // ============
  3564.  
  3565. #define  ERRCODE_FILEEXISTS      1        // File already exsits
  3566. #define  ERRCODE_BLOBMODIFIED    2        // Another user modified Blob
  3567. #define  ERRCODE_UNKNOWNSQL      3        // Unknown SQL error
  3568. #define  ERRCODE_TABLEEXISTS     4        // Table already exsits
  3569. #define  ERRCODE_PDX10TABLE      5        // Paradox 1.0 tables not supported
  3570.  
  3571. #define  DBIERR_FILEEXISTS       (ERRBASE_OTHER + ERRCODE_FILEEXISTS)
  3572. #define  DBIERR_BLOBMODIFIED     (ERRBASE_OTHER + ERRCODE_BLOBMODIFIED)
  3573. #define  DBIERR_UNKNOWNSQL       (ERRBASE_OTHER + ERRCODE_UNKNOWNSQL)
  3574. #define  DBIERR_TABLEEXISTS      (ERRBASE_OTHER + ERRCODE_TABLEEXISTS)
  3575. #define  DBIERR_PDX10TABLE       (ERRBASE_OTHER + ERRCODE_PDX10TABLE)
  3576.  
  3577. //
  3578.  
  3579. // ERRCAT_COMPATIBILITY
  3580. // =====================
  3581.  
  3582. #define  ERRCODE_DIFFSORTORDER    1        // Sortorders not compatible
  3583. #define  ERRCODE_DIRINUSEBYOLDVER 2        // Directory in use by old version
  3584. #define  ERRCODE_PDX35LDDRIVER    3        // Needs Pdox 3.5 compatible language driver
  3585.  
  3586. #define  DBIERR_DIFFSORTORDER     (ERRBASE_COMPATIBILITY + ERRCODE_DIFFSORTORDER)
  3587. #define  DBIERR_DIRINUSEBYOLDVER  (ERRBASE_COMPATIBILITY + ERRCODE_DIRINUSEBYOLDVER)
  3588. #define  DBIERR_PDX35LDDRIVER     (ERRBASE_COMPATIBILITY + ERRCODE_PDX35LDDRIVER)
  3589.  
  3590. // ERRCAT_OPTPARAM
  3591. // ===============
  3592.  
  3593. #define ERRCODE_REQOPTPARAM     1       // Required optional parameter missing
  3594. #define ERRCODE_INVALIDOPTPARAM 2       // Optional param out-of-range or bad
  3595.  
  3596.  
  3597. #define DBIERR_REQOPTPARAM      (ERRBASE_OPTPARAM + ERRCODE_REQOPTPARAM)
  3598. #define DBIERR_INVALIDOPTPARAM  (ERRBASE_OPTPARAM + ERRCODE_INVALIDOPTPARAM)
  3599.  
  3600. #endif  // NODBIERRS
  3601.  
  3602.  
  3603.  
  3604.  
  3605. #ifndef NODBIPROTOTYPES
  3606. //============================================================================
  3607. //                          DBI prototypes
  3608. //============================================================================
  3609.  
  3610. //                          Environmental
  3611. //----------------------------------------------------------------------------
  3612.  
  3613.  
  3614. DBIResult DBIFN DbiInitFn (           // Initialize the Engine
  3615.       UINT16          iVer,             // Interface Version
  3616.       pDBIEnv         pEnv              // Environment Structure/NULL
  3617.    );
  3618.  
  3619.     // DO NOT CALL THIS DIRECTLY. Use the 'DbiInit' define below.
  3620.  
  3621.     // Initializes the engine environment. Default settings can be overwritten
  3622.     // by supplying the appropriate settings. Defaults are read from the system
  3623.     // configuration file. pEnv can be NULLP to get the system defautls.
  3624.  
  3625. #define DbiInit(pEnv)     DbiInitFn(DBIINTFVER, pEnv)
  3626.  
  3627.  
  3628. DBIResult DBIFN DbiExit(VOID);        // Exit engine
  3629.  
  3630.  
  3631. //============================================================================
  3632. //                         System Level Info
  3633. //============================================================================
  3634.  
  3635. DBIResult DBIFN DbiGetSysVersion (    // Get system version info
  3636.       pSYSVersion    psysVersion
  3637.    );
  3638.  
  3639. DBIResult DBIFN DbiGetSysConfig (     // System configuration
  3640.       pSYSConfig     psysConfig
  3641.    );
  3642.  
  3643. DBIResult DBIFN DbiGetClientInfo (    // Get Client info
  3644.       pCLIENTInfo    pclientInfo
  3645.    );
  3646.  
  3647. DBIResult DBIFN DbiGetSysInfo (       // Get system status/info
  3648.       pSYSInfo       psysInfo
  3649.    );
  3650.  
  3651. DBIResult DBIFN DbiLoadDriver (       // Load a given driver
  3652.       pCHAR          pszDriverType      // Driver name
  3653.    );
  3654.  
  3655. //============================================================================
  3656. //                            Sessions
  3657. //============================================================================
  3658.  
  3659. DBIResult DBIFN DbiStartSession (     // Start a new session
  3660.       pCHAR          pszName,           // Name (Optional)
  3661.       phDBISes       phSes  ,           // Session
  3662.       pCHAR          pNetDir            // Netfile directory for session (opt)
  3663.    );
  3664.  
  3665. DBIResult DBIFN DbiGetCurrSession (   // Get the current session
  3666.       phDBISes       phSes              // Session
  3667.    );
  3668.  
  3669. DBIResult DBIFN DbiSetCurrSession (   // Set the current session
  3670.       hDBISes        hSes               // Session/NULL
  3671.    );
  3672.  
  3673. DBIResult DBIFN DbiCloseSession (     // Close the current session
  3674.       hDBISes        hSes               // Session
  3675.    );
  3676.  
  3677. DBIResult DBIFN DbiGetSesInfo (       // Get current session info
  3678.       pSESInfo       psesInfo
  3679.    );
  3680.  
  3681. DBIResult DBIFN DbiSetPrivateDir (    // Set Private Directory for session
  3682.       pCHAR          pszDir             // Directory name/NULL
  3683.    );
  3684.  
  3685.  
  3686. //============================================================================
  3687. //                     Datababase, Schema and File inquiry
  3688. //============================================================================
  3689.  
  3690.  
  3691.  
  3692. DBIResult DBIFN DbiOpenDatabase (     // Open a database
  3693.       pCHAR          pszDbName,         // Database name
  3694.       pCHAR          pszDbType,         // Database type (NULL: Universal)
  3695.       DBIOpenMode    eOpenMode,         // Open type
  3696.       DBIShareMode   eShareMode,        // Share type
  3697.       pCHAR          pszPassword,       // Password
  3698.       UINT16         iOptFlds,          // Number of optional Params
  3699.       pFLDDesc       pOptFldDesc,       // Optional Field Descriptors
  3700.       pBYTE          pOptParams,        // Optional Params
  3701.       phDBIDb        phDb               // Returnd database handle
  3702.     );
  3703.  
  3704. DBIResult DBIFN DbiSetDirectory (     // Set the current directory
  3705.       hDBIDb         hDb,               // Universal database handle
  3706.       pCHAR          pszDir             // Directory/NULL
  3707.     );
  3708.  
  3709. DBIResult DBIFN DbiGetDirectory (     // Get the current/default directory
  3710.       hDBIDb         hDb,               // Universal database handle
  3711.       BOOL           bDefault,          // True for default
  3712.       pCHAR          pszDir             // Returned directory 
  3713.     );
  3714.  
  3715. DBIResult DBIFN DbiOpenTableList (    // Open a cursor on "Tables"
  3716.       hDBIDb         hDb,               // Database handle
  3717.       BOOL           bExtended,         // True for extended info
  3718.       BOOL           bSystem,           // True to include system tables
  3719.       pCHAR          pszWild,           // Wild card name
  3720.       phDBICur       phCur              // Returned cursor
  3721.     );
  3722.  
  3723. DBIResult DBIFN DbiOpenFileList (     // Open a cursor on "Files"
  3724.       hDBIDb         hDb,               // Universal database handle
  3725.       pCHAR          pszWild,           // Wild card name
  3726.       phDBICur       phCur              // Returned cursor
  3727.     );
  3728.  
  3729. DBIResult DBIFN DbiOpenIndexList (    // Return "Indexes" for a table
  3730.       hDBIDb         hDb,               // Database handle
  3731.       pCHAR          pszTableName,      // Table name
  3732.       pCHAR          pszDriverType,     // Driver type
  3733.       phDBICur       phCur);            // Returned cursor on "Indexes"
  3734.                                       
  3735. DBIResult DBIFN DbiOpenFieldList (    // Return "Fields" for a table
  3736.       hDBIDb         hDb,               // Database handle
  3737.       pCHAR          pszTableName,      // Table name
  3738.       pCHAR          pszDriverType,     // Driver type
  3739.       BOOL           bPhyTypes,         // True, for physical types
  3740.       phDBICur       phCur);            // Returned cursor on "Fields"
  3741.  
  3742. DBIResult DBIFN DbiOpenVchkList (     // Return "Checks" for a table
  3743.       hDBIDb         hDb,               // Database handle
  3744.       pCHAR          pszTableName,      // Table name
  3745.       pCHAR          pszDriverType,     // Driver Type
  3746.       phDBICur       phChkCur);         // Returned cursor on "Checks"
  3747.  
  3748. DBIResult DBIFN DbiOpenRintList (     // Return Integrity checks
  3749.       hDBIDb         hDb,               // Database handle
  3750.       pCHAR          pszTableName,      // Table name
  3751.       pCHAR          pszDriverType,     // Driver type
  3752.       phDBICur       phChkCur);         // Returned cursor on "Ref Int".
  3753.  
  3754. DBIResult DBIFN DbiOpenSecurityList ( // Return security descriptions
  3755.       hDBIDb         hDb,               // Database handle
  3756.       pCHAR          pszTableName,      // Table name
  3757.       pCHAR          pszDriverType,     // Driver type
  3758.       phDBICur       phSecCur           // Returned cursor on sec list
  3759.    );
  3760.  
  3761. DBIResult DBIFN DbiOpenFamilyList (   // Return family members
  3762.       hDBIDb         hDb,               // Database handle
  3763.       pCHAR          pszTableName,      // Table name
  3764.       pCHAR          pszDriverType,     // Driver type
  3765.       phDBICur       phFmlCur           // Returned cursor on "Family"
  3766.    );
  3767.  
  3768. DBIResult DBIFN DbiOpenSPList(        // Open a cursor on "Stored Procedures"
  3769.       hDBIDb         hDb,               // Universal database handle
  3770.       BOOL           bExtended,         // True for extended info (N/A)
  3771.       BOOL           bSystem,           // True to include system procedures
  3772.       pCHAR          pszQual,           // Qualifier (N/A)
  3773.       phDBICur       phCur              // Returned cursor
  3774.    );
  3775.  
  3776. DBIResult DBIFN DbiOpenSPParamList (    // Return "Parameters" for a stored procedure
  3777.       hDBIDb         hDb,               // Database handle
  3778.       pCHAR          pszSPName,         // Stored procedure name
  3779.       BOOL           bPhyTypes,         // True, for physical types
  3780.       UINT16         uOverload,         // Overload number
  3781.       phDBICur       phCur              // Returned cursor on "Parameters"
  3782.   );
  3783.  
  3784. DBIResult DBIFN DbiCloseDatabase (     // Close a database
  3785.       phDBIDb        phDb                // Pointer to database handle
  3786.     );
  3787.  
  3788. //============================================================================
  3789. //                                  Capabilities
  3790. //============================================================================
  3791.  
  3792. DBIResult DBIFN DbiOpenDriverList (   // Get a list of driver names
  3793.       phDBICur       phCur              // Returned cursor
  3794.    );
  3795.  
  3796. DBIResult DBIFN DbiGetDriverDesc (    // Get description for a given type
  3797.       pCHAR          pszDriverType,     // Symbolic name for driver type
  3798.       pDRVType       pdrvType           // Driver type description
  3799.    );
  3800.  
  3801. DBIResult DBIFN DbiOpenDatabaseList ( // Get a list of registered databases
  3802.       phDBICur       phCur              // Returned cursor
  3803.    );
  3804.  
  3805. DBIResult DBIFN DbiGetDatabaseDesc (  // Get a description of a logical db
  3806.       pCHAR          pszName,           // Name of logical database
  3807.       pDBDesc        pdbDesc            // Database description
  3808.    );
  3809.  
  3810. DBIResult DBIFN DbiOpenTableTypesList ( // Get a list of table types
  3811.       pCHAR          pszDriverType,     // Driver type
  3812.       phDBICur       phCur              // Returned cursor
  3813.    );
  3814.  
  3815. DBIResult DBIFN DbiGetTableTypeDesc ( // Get Table capabilities
  3816.       pCHAR          pszDriverType,     // Driver type
  3817.       pCHAR          pszTableType,      // Table type
  3818.       pTBLType       ptblType           // Table Capabilities
  3819.    );
  3820.  
  3821.  
  3822. DBIResult DBIFN DbiOpenFieldTypesList ( // Get a list of field types
  3823.       pCHAR          pszDriverType,     // Driver type
  3824.       pCHAR          pszTblType,        // Table type (Optional)
  3825.       phDBICur       phCur              // Returned cursor
  3826.    );
  3827.  
  3828. DBIResult DBIFN DbiGetFieldTypeDesc ( // Get list of field types
  3829.       pCHAR          pszDriverType,     // Driver type
  3830.       pCHAR          pszTableType,      // Table type
  3831.       pCHAR          pszFieldType,      // Field type  (Physical only)
  3832.       pFLDType       pfldType           // Field type description
  3833.    );
  3834.  
  3835. DBIResult DBIFN DbiOpenIndexTypesList ( // Get list of index types
  3836.       pCHAR          pszDriverType,     // Driver type
  3837.       phDBICur       phCur              // Returned cursor
  3838.    );
  3839.  
  3840. DBIResult DBIFN DbiGetIndexTypeDesc ( // Get description of given idx type
  3841.       pCHAR          pszDriverType,     // Driver type
  3842.       pCHAR          pszIndexType,      // Index type
  3843.       pIDXType       pidxType           // Index description
  3844.    );
  3845.  
  3846. DBIResult DBIFN DbiOpenLdList (       // Get a list of Lang Drivers
  3847.       phDBICur       phCur              // Returned cursor
  3848.    );
  3849.  
  3850. //===========================================================================
  3851. //                      Table Open, Properties & Structure
  3852. //===========================================================================
  3853.  
  3854. DBIResult DBIFN DbiOpenTable (        // Open a table
  3855.       hDBIDb         hDb,               // Database handle
  3856.       pCHAR          pszTableName,      // Table name or file name
  3857.       pCHAR          pszDriverType,     // Driver type                 /NULL
  3858.       pCHAR          pszIndexName,      // Index to be used for access /NULL
  3859.       pCHAR          pszIndexTagName,   // Index tag name              /NULL
  3860.       UINT16         iIndexId,          // Index number                /0
  3861.       DBIOpenMode    eOpenMode,         // Read or RW
  3862.       DBIShareMode   eShareMode,        // Excl or Share
  3863.       XLTMode        exltMode,          // Xlate mode
  3864.       BOOL           bUniDirectional,   // Uni or Bi directional 
  3865.       pBYTE          pOptParams,        // Optional params /NULL
  3866.       phDBICur       phCursor           // Returns Cursor handle
  3867.     );
  3868.  
  3869.  
  3870. DBIResult DBIFN DbiGetCursorProps (   // Get Cursor properties
  3871.       hDBICur        hCursor,           // Cursor handle
  3872.       pCURProps      pcurProps          // Cursor properties
  3873.     );
  3874.  
  3875. DBIResult DBIFN DbiGetObjFromName (   // Get object from name
  3876.       DBIOBJType     eObjType   ,       // Object handle
  3877.       pCHAR          pszObjName ,       // Name of object /NULL
  3878.       phDBIObj       phObj              // Returned object handle
  3879.    );
  3880.  
  3881. DBIResult DBIFN DbiGetObjFromObj (    // Get associated object
  3882.       hDBIObj        hObj       ,       // Object handle
  3883.       DBIOBJType     eObjType   ,       // Type of associated object
  3884.       phDBIObj       phObj              // Returns object of eObjType
  3885.    );
  3886.  
  3887. DBIResult DBIFN DbiGetProp (          // Get property
  3888.       hDBIObj        hObj   ,           // Object handle
  3889.       UINT32         iProp  ,           // Property to retrieve
  3890.       pVOID          pPropValue,        // == NULL, validate iProp for getting
  3891.       UINT16         iMaxLen,           // Length of buffer pPropValue
  3892.       pUINT16        piLen              // Returns required length
  3893.    );
  3894.  
  3895. DBIResult DBIFN DbiSetProp (          // Set property
  3896.       hDBIObj        hObj   ,           // Object handle
  3897.       UINT32         iProp  ,           // Property to set
  3898.       UINT32         iPropValue         // Property value
  3899.    );
  3900.  
  3901. DBIResult DBIFN DbiValidateProp (     // Validate a property 
  3902.       hDBIObj        hObj,              // Object handle
  3903.       UINT32         iProp,             // property to validate
  3904.       BOOL           bSetting           // TRUE:setting, FALSE:getting
  3905.   );
  3906.  
  3907. DBIResult DBIFN DbiGetFieldDescs (    // Get field descriptions
  3908.       hDBICur        hCursor,           // Cursor handle
  3909.       pFLDDesc       pfldDesc           // Array of field descriptors
  3910.     );
  3911.  
  3912. DBIResult DBIFN DbiGetCursorForTable (// Find cursor for a given table
  3913.       hDBIDb         hDb,               // Database handle
  3914.       pCHAR          pszTableName,      // Table name
  3915.       pCHAR          pszDriverType,     // Driver type / NULL 
  3916.       phDBICur       phCursor           // Returned cursor
  3917.    );
  3918.  
  3919. DBIResult DBIFN DbiCloneCursor (      // Return a duplicate cursor
  3920.       hDBICur        hCurSrc,           // Source cursor
  3921.       BOOL           bReadOnly,         // If TRUE, read only mode
  3922.       BOOL           bUniDirectional,   // If TRUE, Uni directional
  3923.       phDBICur       phCurNew           // Destination cursor address
  3924.     );
  3925.  
  3926. DBIResult DBIFN DbiCloseCursor (      // Closes cursor
  3927.       phDBICur       phCursor           // Pntr to Cursor handle
  3928.     );
  3929.  
  3930.  
  3931. //============================================================================
  3932. //                      Index Manipulation & Usage
  3933. //============================================================================
  3934.  
  3935. DBIResult DBIFN DbiOpenIndex (        // Open an index
  3936.       hDBICur        hCursor,           // Cursor handle
  3937.       pCHAR          pszIndexName,      // Index Name
  3938.       UINT16         iIndexId           // Index number (if applicable)
  3939.    );
  3940.  
  3941. DBIResult DBIFN DbiCloseIndex (       // Close an index
  3942.       hDBICur        hCursor,           // Cursor handle
  3943.       pCHAR          pszIndexName,      // Index Name
  3944.       UINT16         iIndexId           // Index number
  3945.    );
  3946.  
  3947. DBIResult DBIFN DbiSwitchToIndex (    // Change index order of access
  3948.       phDBICur       phCursor,          // Cursor handle (In/Out)
  3949.       pCHAR          pszIndexName,      // Index name
  3950.       pCHAR          pszTagName,        // Tag name (if applicable)
  3951.       UINT16         iIndexId,          // Index number 
  3952.       BOOL           bCurrRec           // Position at current rec
  3953.     );
  3954.  
  3955. DBIResult DBIFN DbiGetIndexDesc (     // Get index properties
  3956.       hDBICur        hCursor,           // Cursor handle
  3957.       UINT16         iIndexSeqNo,       // Index number
  3958.       pIDXDesc       pidxDesc           // Returned index description
  3959.    );
  3960.  
  3961. DBIResult DBIFN DbiGetIndexDescs (    // Get index properties
  3962.       hDBICur        hCursor,           // Cursor handle
  3963.       pIDXDesc       pidxDesc           // Returned index descriptors
  3964.    );
  3965.  
  3966. DBIResult DBIFN DbiGetIndexForField ( // Get index desc for given field
  3967.       hDBICur        hCursor,           // Cursor handle
  3968.       UINT16         iFld,              // Field Number (1..N)
  3969.       BOOL           bProdTagOnly,      // If TRUE, only xBASE prod tags will be returned
  3970.       pIDXDesc       pidxDesc           // (Optional)
  3971.    );
  3972.  
  3973. DBIResult DBIFN DbiGetIndexSeqNo(     // Get index sequence number
  3974.       hDBICur        hCursor,           // Cursor handle
  3975.       pCHAR          pszIndexName,      // Index name
  3976.       pCHAR          pszTagName,        // Tag name (if applicable)
  3977.       UINT16         iIndexId,          // Index number
  3978.       pUINT16        piIndexSeqNo       // Index number
  3979.    );
  3980.  
  3981. DBIResult DBIFN DbiSetToKey  (        // Set key condition
  3982.       hDBICur           hCursor,        // Cursor handle
  3983.       DBISearchCond     eSearchCond,    // Search condition (default is =)
  3984.       BOOL              bDirectKey,     // Key is supplied directly
  3985.       UINT16            iFields,        // No of full fields to match
  3986.       UINT16            iLen,           // Partial key len of last field
  3987.       pBYTE             pBuff           // Either Record buffer or Key itself
  3988.     );
  3989.  
  3990. DBIResult DBIFN DbiExtractKey (       // Get the key value of current record
  3991.       hDBICur           hCursor,        // Cursor handle
  3992.       pBYTE             pRecBuf,        // Record buffer (optional)
  3993.       pBYTE             pKeyBuf         // Returned. Key bytes.
  3994.    );
  3995.  
  3996. DBIResult DBIFN DbiSetRange (         // Set cursor to a range
  3997.       hDBICur           hCursor,        // Cursor
  3998.       BOOL              bKeyItself,     // Whether Key or Record buffer
  3999.       UINT16            iFields1,       // Key fields to be mathced in full
  4000.       UINT16            iLen1,          // Key length to compare
  4001.       pBYTE             pKey1,          // Top/Left key in Range
  4002.       BOOL              bKey1Incl,      // If Inclusive of Key1
  4003.       UINT16            iFields2,       // Key fields to be mathced in full
  4004.       UINT16            iLen2,          // Key length to compare
  4005.       pBYTE             pKey2,          // Bottom/Right key in Range
  4006.       BOOL              bKey2Incl       // If Inclusive of Key2
  4007.    );
  4008.  
  4009. DBIResult DBIFN DbiResetRange (       // Reset range
  4010.       hDBICur        hCursor            // cursor handle
  4011.    );
  4012.  
  4013. DBIResult DBIFN DbiCompareKeys (      // Compare two keys
  4014.       hDBICur           hCursor,        // Cursor handle
  4015.       pBYTE             pKey1,          // Key buffer 1 to compare
  4016.       pBYTE             pKey2,          // Key buffer 2 (Or NULL)
  4017.       UINT16            iFields,        // Fields to compare in full
  4018.       UINT16            iLen,           // Partial key to compare
  4019.       pINT16            piResult        // Compare result
  4020.    );
  4021.  
  4022. DBIResult DBIFN DbiGetRecordForKey (  // Find a record matching key
  4023.       hDBICur           hCursor,        // Cursor handle
  4024.       BOOL              bDirectKey,     // Key is supplied directly
  4025.       UINT16            iFields,        // No of full fields to match
  4026.       UINT16            iLen,           // Partial key len of last field
  4027.       pBYTE             pKey,           // Either Record buffer or Key itself
  4028.       pBYTE             pRecBuff        // (Optional) Record buffer
  4029.    );
  4030.  
  4031. //=============================================================================
  4032. //                          Validity check and referential integrity
  4033. //=============================================================================
  4034.  
  4035. DBIResult DBIFN DbiGetVchkDesc (      // Get valcheck descriptor
  4036.       hDBICur        hCursor,           // Cursor handle
  4037.       UINT16         iValSeqNo,         // Valcheck sequence number
  4038.       pVCHKDesc      pvalDesc           // Returned valcheck description
  4039.    );
  4040.  
  4041. DBIResult DBIFN DbiGetRintDesc (      // Get referential integrity descriptor
  4042.       hDBICur        hCursor,           // Cursor handle
  4043.       UINT16         iRintSeqNo,        // Rint sequence number
  4044.       pRINTDesc      printDesc          // Returned rint description
  4045.    );
  4046.  
  4047. //=============================================================================
  4048. //                              Cursor Maintenance
  4049. //=============================================================================
  4050.  
  4051.  
  4052. DBIResult DBIFN DbiSetToBegin (       // Reset cursor to beginning
  4053.       hDBICur        hCursor            // Cursor handle
  4054.    );
  4055.  
  4056. DBIResult DBIFN DbiSetToEnd (         // Reset cursor to ending
  4057.       hDBICur        hCursor            // Cursor handle
  4058.     );
  4059.  
  4060. DBIResult DBIFN DbiSetToCursor (      // Set cursor to another cursor position
  4061.       hDBICur        hDest,             // Destination cursor
  4062.       hDBICur        hSrc               // Source cursor
  4063.    );
  4064.  
  4065. DBIResult DBIFN DbiGetBookMark (      // Get a book-mark
  4066.       hDBICur        hCur,              // Cursor
  4067.       pBYTE          pBookMark          // Pointer to Book-Mark
  4068.    );
  4069.  
  4070. DBIResult DBIFN DbiSetToBookMark (    // Position to a Book-Mark
  4071.       hDBICur        hCur,              // Cursor
  4072.       pBYTE          pBookMark          // Pointer to Book-Mark
  4073.    );
  4074.  
  4075. DBIResult DBIFN DbiCompareBookMarks ( // Compare two Book-marks
  4076.       hDBICur        hCur,              // Cursor
  4077.       pBYTE          pBookMark1,        // Book mark 1
  4078.       pBYTE          pBookMark2,        // Book mark 2
  4079.       pCMPBkMkRslt   pCmpBkmkResult     // Compare result
  4080.    );
  4081.  
  4082. //============================================================================
  4083. //                      Data Access: Logical Record Level
  4084. //============================================================================
  4085.  
  4086.  
  4087. DBIResult DBIFN DbiGetNextRecord (    // Find/Get the next record
  4088.       hDBICur           hCursor,        // Cursor handle
  4089.       DBILockType       eLock,          // Optional lock request
  4090.       pBYTE             pRecBuff,       // Record buffer(client)
  4091.       pRECProps         precProps       // Optional record properties
  4092.     );
  4093.  
  4094. DBIResult DBIFN DbiGetPriorRecord (   // Find/Get the prior record
  4095.       hDBICur           hCursor,        // Cursor handle
  4096.       DBILockType       eLock,          // Optional lock request
  4097.       pBYTE             pRecBuff,       // Record buffer (client)
  4098.       pRECProps         precProps       // Optional record properties
  4099.     );
  4100.  
  4101. DBIResult DBIFN DbiGetRecord (        // Gets the current record
  4102.       hDBICur           hCursor,        // Cursor handle
  4103.       DBILockType       eLock,          // Optional lock request
  4104.       pBYTE             pRecBuff,       // Record buffer(client)
  4105.       pRECProps         precProps       // Optional record properties
  4106.     );
  4107.  
  4108. DBIResult DBIFN DbiGetRelativeRecord (// Find/Get a record by record number
  4109.       hDBICur           hCursor,        // Cursor handle
  4110.       INT32             iPosOffset,     // offset from current position
  4111.       DBILockType       eLock,          // Optional lock request
  4112.       pBYTE             pRecBuff,       // Record buffer(client)
  4113.       pRECProps         precProps       // Optional record properties
  4114.     );
  4115.  
  4116. DBIResult DBIFN DbiInitRecord (       // Initialize record area
  4117.       hDBICur        hCursor,           // Cursor handle
  4118.       pBYTE          pRecBuff           // Record buffer
  4119.     );
  4120.  
  4121. DBIResult DBIFN DbiInsertRecord (     // Inserts a new record
  4122.       hDBICur        hCursor,           // Cursor handle
  4123.       DBILockType    eLock,             // Optional lock on this rec
  4124.       pBYTE          pRecBuff           // New Record (client)
  4125.     );
  4126.  
  4127. DBIResult DBIFN DbiModifyRecord (     // Updates the current record
  4128.       hDBICur        hCursor,           // Cursor handle
  4129.       pBYTE          pRecBuf,           // Modified record
  4130.       BOOL           bFreeLock          // Free record lock
  4131.     );
  4132.  
  4133. DBIResult DBIFN DbiDeleteRecord (     // Deletes the current record
  4134.       hDBICur        hCursor,           // Cursor handle
  4135.       pBYTE          pRecBuf            // Copy of deleted record
  4136.     );
  4137.  
  4138. DBIResult DBIFN DbiReadBlock (        // Read a block of records
  4139.       hDBICur        hCursor,           // Cursor handle
  4140.       pUINT32        piRecords,         // Number of records to read
  4141.       pBYTE          pBuf               // Buffer
  4142.    );
  4143.  
  4144. DBIResult DBIFN DbiWriteBlock (       // Write a block of records
  4145.       hDBICur        hCursor,           // Cursor handle
  4146.       pUINT32        piRecords,         // Number of records to write/written
  4147.       pBYTE          pBuf               // Buffer
  4148.    );
  4149.  
  4150. DBIResult DBIFN DbiAppendRecord (     // Inserts a new record
  4151.       hDBICur        hCursor,           // Cursor handle
  4152.       pBYTE          pRecBuff           // New Record (client)
  4153.     );
  4154.  
  4155. DBIResult DBIFN DbiUndeleteRecord (   // Undeletes the current record
  4156.       hDBICur        hCursor            // Cursor handle
  4157.     );
  4158.  
  4159. DBIResult DBIFN DbiGetSeqNo (         // Get logical record number
  4160.       hDBICur        hCursor,           // Cursor handle
  4161.       pUINT32        piSeqNo            // Pointer to sequence number
  4162.    );
  4163.  
  4164. DBIResult DBIFN DbiSetToSeqNo (       // Position to a logical record number
  4165.       hDBICur        hCursor,           // Cursor handle
  4166.       UINT32         iSeqNo             // Sequence number
  4167.    );
  4168.  
  4169. DBIResult DBIFN DbiGetRecordCount (   // Get the current number of records
  4170.       hDBICur        hCursor,           // Cursor handle
  4171.       pUINT32        piRecCount         // Number of records
  4172.    );
  4173.  
  4174.  
  4175. DBIResult DBIFN DbiSetToRecordNo (    // Position to Physical Rec#
  4176.       hDBICur        hCursor,           // Cursor handle
  4177.       UINT32         iRecNo             // Physical record number
  4178.    );
  4179.  
  4180. DBIResult DBIFN DbiSaveChanges (      // Flush all buffered changes
  4181.       hDBICur        hCursor            // Cursor handle
  4182.    );
  4183. DBIResult DBIFN DbiForceReread (      // Force Reread of buffers from Disk
  4184.       hDBICur        hCursor            // Cursor
  4185.    );
  4186.  
  4187. DBIResult DBIFN DbiCheckRefresh (VOID); // Check refresh for session
  4188.  
  4189. DBIResult DBIFN DbiMakePermanent (    // Make temporary table permanent
  4190.       hDBICur     hCursor,              // Cursor handle
  4191.       pCHAR       pszName,              // Rename temporary table
  4192.       BOOL        bOverWrite            // Overwrite existing file
  4193.    );
  4194.  
  4195.  
  4196. //============================================================================
  4197. //                            Field Level Access
  4198. //============================================================================
  4199.  
  4200. DBIResult DBIFN DbiGetField(          // Get Field value
  4201.       hDBICur        hCursor,           // Cursor
  4202.       UINT16         iField,            // Field # (1..n)
  4203.       pBYTE          pRecBuff,          // Record buffer
  4204.       pBYTE          pDest,             // Destination field buffer
  4205.       pBOOL          pbBlank            // Returned : is field blank
  4206.    );
  4207.  
  4208. DBIResult DBIFN DbiPutField(          // Put a value in the record buffer
  4209.       hDBICur        hCursor,           // Cursor
  4210.       UINT16         iField,            // Field # (1..n)
  4211.       pBYTE          pRecBuff,          // Record buffer
  4212.       pBYTE          pSrc               // Source field buffer
  4213.    );
  4214.  
  4215. DBIResult DBIFN DbiVerifyField(       // Verifies the field value
  4216.       hDBICur        hCursor,           // Cursor
  4217.       UINT16         iField,            // Field # (1..n)
  4218.       pBYTE          pSrc,              // Field Value
  4219.       pBOOL          pbBlank            // Field is Blank (Returned)
  4220.    );
  4221.  
  4222. DBIResult DBIFN DbiOpenBlob (         // Open a blob for access
  4223.       hDBICur        hCursor,           // Cursor handle
  4224.       pBYTE          pRecBuf,           // Record Buffer
  4225.       UINT16         iField,            // Field number (1..n)
  4226.       DBIOpenMode    eOpenMode          // Open for Read or RW
  4227.     );
  4228.  
  4229. DBIResult DBIFN DbiGetBlobSize (      // Gets the size of a blob
  4230.       hDBICur        hCursor,           // Cursor handle
  4231.       pBYTE          pRecBuf,           // Record Buffer
  4232.       UINT16         iField,            // Field number of blob (1..n)
  4233.       pUINT32        piSize             // Blob size in bytes
  4234.     );
  4235.  
  4236. DBIResult DBIFN DbiGetBlob (          // Read bytes from blob
  4237.       hDBICur        hCursor,           // Cursor handle
  4238.       pBYTE          pRecBuf,           // Record Buffer
  4239.       UINT16         iField,            // Field number of blob (1..n)
  4240.       UINT32         iOffSet,           // Starting position   
  4241.       UINT32         iLen,              // No of bytes to be read   
  4242.       pBYTE          pDest,             // Destination
  4243.       pUINT32        piRead             // Actual no of bytes read
  4244.     );
  4245.  
  4246. DBIResult DBIFN DbiPutBlob (          // Write bytes to blob
  4247.       hDBICur        hCursor,           // Cursor handle
  4248.       pBYTE          pRecBuf,           // Record Buffer
  4249.       UINT16         iField,            // Field number of blob (1..n)
  4250.       UINT32         iOffSet,           // Starting position   
  4251.       UINT32         iLen,              // No of bytes to put   
  4252.       pBYTE          pSrc               // pntr to Source
  4253.     );
  4254.  
  4255. DBIResult DBIFN DbiTruncateBlob (     // Reduces the blob size
  4256.       hDBICur        hCursor,           // Cursor handle
  4257.       pBYTE          pRecBuf,           // Record Buffer
  4258.       UINT16         iField,            // Field number of blob (1..n)
  4259.       UINT32         iLen               // New blob length
  4260.     );
  4261.  
  4262. DBIResult DBIFN DbiFreeBlob (         // Closes the blob
  4263.       hDBICur           hCursor,        // Cursor handle
  4264.       pBYTE             pRecBuf,        // Record Buffer
  4265.       UINT16            iField          // Field number of blob (0..n)
  4266.     );
  4267.  
  4268. DBIResult DBIFN DbiGetBlobHeading (   // Get Blob Heading
  4269.       hDBICur           hCursor,        // Cursor handle
  4270.       UINT16            iField,         // Field number of blob (1..n)
  4271.       pBYTE             pRecBuf,        // Record buffer of owner record
  4272.       pBYTE             pDest           // Destination buffer
  4273.    );
  4274.  
  4275. DBIResult DBIFN DbiSetFieldMap(       // Set a fieldmap
  4276.       hDBICur        hCur,              // Cursor handle
  4277.       UINT16         iFields,           // Number of fields
  4278.       pFLDDesc       pFldDesc           // Array of field descriptions
  4279.    );
  4280.  
  4281.  
  4282. //=============================================================================
  4283. //                                TRANSACTIONS
  4284. //=============================================================================
  4285.  
  4286. DBIResult DBIFN DbiBeginTran (        // Begin a transaction
  4287.    hDBIDb         hDb,                  // Database handle
  4288.    eXILType       eXIL,                 // Transaction isolation level
  4289.    phDBIXact      phXact                // Returned Xact handle
  4290. );
  4291.  
  4292. DBIResult DBIFN DbiEndTran (          // End a transaction
  4293.    hDBIDb         hDb,                  // Database handle
  4294.    hDBIXact       hXact,                // Xact handle
  4295.    eXEnd          eEnd                  // Xact end type
  4296. );
  4297.  
  4298. DBIResult DBIFN DbiGetTranInfo (      // Get transaction info
  4299.    hDBIDb         hDb,                  // Database handle
  4300.    hDBIXact       hXact,                // Xact handle
  4301.    pXInfo         pxInfo                // Xact info
  4302. );
  4303.  
  4304. //=============================================================================
  4305. //                                  LOCKING
  4306. //=============================================================================
  4307.  
  4308. DBIResult DBIFN DbiAcqTableLock (     // Lock a table
  4309.       hDBICur        hCursor,           // Cursor handle
  4310.       DBILockType    eLockType          // Lock type
  4311.     );
  4312.  
  4313. DBIResult DBIFN DbiAcqPersistTableLock (// Get a persistent lock
  4314.       hDBIDb         hDb,               // Database handle
  4315.       pCHAR          pszTableName,      // Table name
  4316.       pCHAR          pszDriverType      // Driver type / NULL
  4317.    );
  4318.  
  4319. DBIResult DBIFN DbiRelPersistTableLock (// Releases a persistent lock
  4320.       hDBIDb         hDb,               // Database handle
  4321.       pCHAR          pszTableName,      // Table name
  4322.       pCHAR          pszDriverType      // Driver type / NULL
  4323.    );
  4324.  
  4325. DBIResult DBIFN DbiRelTableLock (     // Unlocks Table level locks
  4326.       hDBICur        hCursor,           // Cursor handle
  4327.       BOOL           bAll,              // True for all table level locks
  4328.       DBILockType    eLockType          // Specific lock type
  4329.     );
  4330.  
  4331. DBIResult DBIFN DbiRelRecordLock (    // Releases record level locks
  4332.       hDBICur        hCursor,           // Cursor handle
  4333.       BOOL           bAll               // True for all. Default Current.
  4334.     );
  4335.  
  4336. DBIResult DBIFN DbiIsRecordLocked (   // Check if current record is locked
  4337.       hDBICur        hCursor,           // Cursor handle
  4338.       pBOOL          pbLocked           // Rec lock status
  4339.    );
  4340.  
  4341. DBIResult DBIFN DbiIsTableLocked (    // Verify if Table is locked
  4342.       hDBICur        hCursor,           // Cursor handle
  4343.       DBILockType    epdxLock,          // Lock type to verify
  4344.       pUINT16        piLocks            // Nbr of locks of the given type
  4345.    );
  4346.  
  4347. DBIResult DBIFN DbiIsTableShared (    // Verify if this is a shared table
  4348.       hDBICur        hCursor,           // Cursor handle
  4349.       pBOOL          pbShared           // Shared status
  4350.    );
  4351.  
  4352. DBIResult DBIFN DbiOpenLockList (     // Get a list of locks
  4353.       hDBICur        hCursor,           // Cursor handle
  4354.       BOOL           bAllUsers,         // True, for all Users locks
  4355.       BOOL           bAllLockTypes,     // True, for all lock types
  4356.       phDBICur       phLocks            // Returned cursor on Lock list
  4357.    );
  4358.  
  4359. DBIResult DBIFN DbiOpenUserList (     // Get a list of users loggedin
  4360.       phDBICur       phUsers            // Returned cursor on user list
  4361.    );
  4362.  
  4363. DBIResult DBIFN DbiSetLockRetry (     // Set Lock wait time
  4364.       INT16          iWait              // Time in seconds
  4365.    );
  4366.  
  4367. //============================================================================
  4368. //                              Batch Operations
  4369. //============================================================================
  4370.  
  4371.  
  4372. DBIResult DBIFN DbiBatchMove (        // Copy records to destination table
  4373.    pBATTblDesc    pSrcTblDesc,          // Source table identification,
  4374.    hDBICur        hSrcCur,              //  OR source cursor  ( one must be NULL )
  4375.    pBATTblDesc    pDstTblDesc ,         // Destination table identification,
  4376.    hDBICur        hDstCur,              //  OR destination cursor ( one must be NULL )
  4377.    eBATMode       ebatMode,             // Batch mode 
  4378.    UINT16         iFldCount,            // Size of field maps
  4379.    pUINT16        pSrcFldMap,           // Array of source field numbers
  4380.    pCHAR          pszIndexName,         // If update mode, used to match records
  4381.    pCHAR          pszIndexTagName,      // Index tag name
  4382.    UINT16         iIndexId,             // Index  id
  4383.    pCHAR          pszKeyviolName,       // Keyviol table name  (optional)
  4384.    pCHAR          pszProblemsName,      // Problems table name (optional)
  4385.    pCHAR          pszChangedName,       // Changed table name (optional)
  4386.    pUINT32        plProbRecs,           // Number of records to read from source
  4387.    pUINT32        plKeyvRecs,           // Number of records to read from source
  4388.    pUINT32        plChangedRecs,        // Number of records to read from source
  4389.    BOOL           bAbortOnFirstProb,    // If TRUE, abort on first problem rec
  4390.    BOOL           bAbortOnFirstKeyviol, // If TRUE, abort on first keyviol rec
  4391.    pUINT32        plRecsToMove,         // Number of records to read from source
  4392.                                         // Returns number actually read
  4393.    BOOL           bTransliterate        // If TRUE, transliterate character data
  4394.                                         // in fields between src&dst char sets
  4395. );
  4396.  
  4397. DBIResult DBIFN DbiCopyTable (        // Copy one table to another
  4398.       hDBIDb         hDb,               // Database handle
  4399.       BOOL           bOverWrite,        // True, to overwrite existing file
  4400.       pCHAR          pszSrcTableName,   // Source table name
  4401.       pCHAR          pszSrcDriverType,  // Source driver type
  4402.       pCHAR          pszDestTableName   // Destination table name
  4403.    );
  4404.  
  4405. DBIResult DBIFN DbiEmptyTable (       // Deletes all records
  4406.       hDBIDb         hDb,               // Database handle
  4407.       hDBICur        hCursor,           // Cursor (OR)
  4408.       pCHAR          pszTableName,      // Table name
  4409.       pCHAR          pszDriverType      // Driver type /NULL
  4410.     );
  4411.  
  4412. DBIResult DBIFN DbiPackTable (        // Pack a table
  4413.       hDBIDb         hDb,               // Database handle
  4414.       hDBICur        hCursor,           // Cursor (OR)
  4415.       pCHAR          pszTableName,      // Table name
  4416.       pCHAR          pszDriverType,     // Driver type /NULL
  4417.       BOOL           bRegenIdxs         // Regenerate indexes
  4418.     );
  4419.  
  4420. DBIResult DBIFN DbiRegenIndex (       // Regenerate an index
  4421.       hDBIDb         hDb,               // Database handle
  4422.       hDBICur        hCursor,           // Cursor (OR)
  4423.       pCHAR          pszTableName,      // Table name
  4424.       pCHAR          pszDriverType,     // Driver type /NULL
  4425.       pCHAR          pszIndexName,      // Index name
  4426.       pCHAR          pszIndexTagName,   // Index tagname (xbase MDX)
  4427.       UINT16         iIndexId           // Index number
  4428.     );
  4429.  
  4430. DBIResult DBIFN DbiRegenIndexes (     // Regenerate all indexes
  4431.       hDBICur         hCursor           // Cursor
  4432.    );
  4433.  
  4434. DBIResult DBIFN DbiSortTable (        // Sort table
  4435.       hDBIDb         hDb,               // Database handle
  4436.       pCHAR          pszTableName,      // Table name of source
  4437.       pCHAR          pszDriverType,     // Driver type /NULL
  4438.       hDBICur        hSrcCur,           // OR cursor of table to sort
  4439.       pCHAR          pszSortedName,     // Destination table (NULL if sort to self)
  4440.       phDBICur       phSortedCur,       // If non-null, return cursor on destination
  4441.       hDBICur        hDstCur,           // OR cursor of destination 
  4442.       UINT16         iSortFields,       // Number of sort fields
  4443.       pUINT16        piFieldNum,        // Array of field numbers
  4444.       pBOOL          pbCaseInsensitive, // Which fields should sort c-i (Opt)
  4445.       pSORTOrder     pSortOrder,        // Array of Sort orders (Opt)
  4446.       pfSORTCompFn   *ppfSortFn,        // Array of compare fn pntrs (Opt)
  4447.       BOOL           bRemoveDups,       // TRUE : Remove duplicates
  4448.       hDBICur        hDuplicatesCur,    // Cursor to duplicates table (Opt)
  4449.       pUINT32        plRecsSort         // In/out param. - sort this number 
  4450.                                         // of records from current position, return 
  4451.                                         // number actually output to dest.  (Opt)
  4452. );
  4453.  
  4454.  
  4455. //============================================================================
  4456. //                           Create & Restructure
  4457. //============================================================================
  4458.  
  4459. DBIResult DBIFN DbiCreateTable (      // Create a new table
  4460.       hDBIDb         hDb,               // Database handle
  4461.       BOOL           bOverWrite,        // True, to overwrite existing file.
  4462.       pCRTblDesc     pcrTblDsc          // Table description
  4463.    );
  4464.  
  4465. DBIResult DBIFN DbiCreateInMemTable ( // Create a temporary table (Logical)
  4466.       hDBIDb         hDb,               // Database handle
  4467.       pCHAR          pszName,           // Logical Name
  4468.       UINT16         iFields,           // No of fields
  4469.       pFLDDesc       pfldDesc,          // Array of field descriptors
  4470.       phDBICur       phCursor           // Returned cursor handle
  4471.    );
  4472.  
  4473. DBIResult DBIFN DbiCreateTempTable (  // Create temporary table (Physical)
  4474.       hDBIDb         hDb,               // Database handle
  4475.       pCRTblDesc     pcrTblDsc,         // Table description
  4476.       phDBICur       phCursor           // Returned cursor on table
  4477.    );
  4478.  
  4479. DBIResult DBIFN DbiDoRestructure (    // Restructure a table
  4480.       hDBIDb         hDb,               // Database handle
  4481.       UINT16         iTblDescCount,     // Number of table descriptors (1)
  4482.       pCRTblDesc     pTblDesc,          // Array of table descs
  4483.       pCHAR          pszSaveAs,         // Restructure to this table
  4484.       pCHAR          pszKeyviolName,    // Keyviol table name  (optional)
  4485.       pCHAR          pszProblemsName,   // Problems table name (optional)
  4486.       BOOL           bAnalyzeOnly       // Analyze restructure
  4487.    );
  4488.  
  4489. DBIResult DBIFN DbiRenameTable (      // Rename table & family
  4490.       hDBIDb         hDb,               // Database handle
  4491.       pCHAR          pszOldName,        // Old name
  4492.       pCHAR          pszDriverType,     // Driver type /NULL
  4493.       pCHAR          pszNewName         // New name
  4494.    );
  4495.  
  4496. DBIResult DBIFN DbiDeleteTable (      // Delete a table
  4497.       hDBIDb         hDb,               // Database handle
  4498.       pCHAR          pszTableName,      // Name including any path
  4499.       pCHAR          pszDriverType      // Driver type /NULL
  4500.    );
  4501.  
  4502. DBIResult DBIFN DbiAddIndex (         // Add a new index
  4503.       hDBIDb         hDb,               // Database handle
  4504.       hDBICur        hCursor,           // Cursor (OR)
  4505.       pCHAR          pszTableName,      // Table name including any path
  4506.       pCHAR          pszDriverType,     // Driver type /NULL
  4507.       pIDXDesc       pIdxDesc    ,      // Description of the index
  4508.       pCHAR          pszKeyviolName     // Keyviol table name (optional)
  4509.    );
  4510.  
  4511. DBIResult DBIFN DbiDeleteIndex (      // Delete index
  4512.       hDBIDb         hDb,               // Database handle
  4513.       hDBICur        hCursor,           // Cursor (OR)
  4514.       pCHAR          pszTableName,      // Table name 
  4515.       pCHAR          pszDriverType,     // Driver type /NULL
  4516.       pCHAR          pszIndexName,      // Index name
  4517.       pCHAR          pszIndexTagName,   // Index tagname (xbase MDX)
  4518.       UINT16         iIndexId           // Index number
  4519.    );
  4520.  
  4521. //===========================================================================
  4522. //                            Error Info
  4523. //===========================================================================
  4524.  
  4525. DBIResult DBIFN DbiGetErrorEntry (    // Get error entry
  4526.       UINT16         uEntry,            // Error stack entry
  4527.       pUINT32        pulNativeError,    // Returned. Native error code, if any
  4528.       pCHAR          pszError           // Returned. Error string, if any
  4529.    );
  4530.  
  4531. DBIResult DBIFN DbiGetErrorInfo (     // Return info on last error
  4532.       BOOL           bFull,             // If Full details
  4533.       pDBIErrInfo    pErrInfo           // Error Info
  4534.    );
  4535.  
  4536. DBIResult DBIFN DbiGetErrorString (   // Get message for error code
  4537.       DBIResult      rslt,              // Engine error code
  4538.       pCHAR          pszError           // Error string for the error
  4539.    );
  4540.  
  4541. DBIResult DBIFN DbiGetErrorContext (  // Get specific Context if available
  4542.       INT16          eContext,          // Context type
  4543.       pCHAR          pszContext         // Context string (MAXMSGLEN +1)
  4544.    );
  4545.  
  4546. //============================================================================
  4547. //                              Dbi Services
  4548. //============================================================================
  4549.  
  4550. DBIResult DBIFN DbiDateEncode (       // Encode Date components into Date
  4551.       UINT16         iMon,              // Month    (1..12)
  4552.       UINT16         iDay,              // Day      (1..31)
  4553.       INT16          iYear,             // Year     (0..2**16-1)
  4554.       pDBIDATE       pdateD             // Encoded date
  4555.    );
  4556.  
  4557. DBIResult DBIFN DbiDateDecode (       // Decode Date into components
  4558.       DBIDATE        dateD,             // Encoded Date
  4559.       pUINT16        piMon,             // Month
  4560.       pUINT16        piDay,             // Day
  4561.       pINT16         piYear             // Year
  4562.    );
  4563.  
  4564. DBIResult DBIFN DbiTimeEncode (       // Encode Time components into TIME
  4565.       UINT16         iHour,             // Hours (0..23)
  4566.       UINT16         iMin,              // Minutes (0..59)
  4567.       UINT16         iMilSec,           // Milli Seconds (0..59999)
  4568.       pTIME          ptimeT             // Encoded Time
  4569.    );
  4570.  
  4571. DBIResult DBIFN DbiTimeDecode (       // Decode TIME into components
  4572.       TIME           timeT,             // Encoded Time
  4573.       pUINT16        piHour,            // Hours (0..23)
  4574.       pUINT16        piMin,             // Minutes (0..59)
  4575.       pUINT16        piMilSec           // Milli Seconds (0..59999)
  4576.    );
  4577.  
  4578. DBIResult DBIFN DbiTimeStampEncode (  // Encode Date & TIme into Date+Time
  4579.       DBIDATE        dateD,             // Encoded Date
  4580.       TIME           timeT,             // Encoded Time
  4581.       pTIMESTAMP     ptsTS              // Encoded Date+Time
  4582.    );
  4583.  
  4584. DBIResult DBIFN DbiTimeStampDecode (  // Decode Date & Time from Date+Time
  4585.       TIMESTAMP      tsTS,              // Encoded Date+Time
  4586.       pDBIDATE       pdateD,            // Encoded Date
  4587.       pTIME          ptimeT             // Encoded Time
  4588.    );
  4589.  
  4590.  
  4591. DBIResult DBIFN DbiBcdFromFloat(      // Converts FLOAT number into FMTBcd format
  4592.        pDFLOAT     piVal   ,            // Float to convert
  4593.        UINT16      iPrecision,          // Precision of BCD
  4594.        UINT16      iPlaces ,            // Number of decimals
  4595.        pFMTBcd     pBcd                 // returns Bcd number (length = iPrecision +2)
  4596.     );
  4597.  
  4598. DBIResult DBIFN DbiBcdToFloat(        // Converts FMTBcd number to FLOAT
  4599.       pFMTBcd      pBcd,                // Bcd number to convert
  4600.       pDFLOAT      piVal                // Returns converted float
  4601.    );
  4602.  
  4603. //===========================================================================
  4604. //                           CallBacks
  4605. //===========================================================================
  4606.  
  4607. DBIResult DBIFN DbiRegisterCallBack ( // Register a call back fn
  4608.       hDBICur        hCursor,           // Cursor (Optional)
  4609.       CBType         ecbType,           // Type of call back
  4610.       UINT32         iClientData,       // Pass-thru client data
  4611.       UINT16         iCbBufLen,         // Callback buffer len
  4612.       pVOID          pCbBuf,            // Pointer to callback buffer
  4613.       pfDBICallBack  pfCb               // Call back fn being registered
  4614.    );
  4615.  
  4616. DBIResult DBIFN DbiGetCallBack (      // Register a call back fn
  4617.       hDBICur        hCursor,           // Cursor (Optional)
  4618.       CBType         ecbType,           // Type of call back
  4619.       pUINT32        piClientData,      // Pass-thru client data
  4620.       pUINT16        piCbBufLen,        // Callback buffer len
  4621.       ppVOID         ppCbBuf,           // Pointer to callback buffer
  4622.       ppfDBICallBack ppfCb              // Call back fn being registered
  4623.    );
  4624.  
  4625. //============================================================================
  4626. //                          Date, time formats
  4627. //============================================================================
  4628.  
  4629.  
  4630. DBIResult DBIFN DbiGetDateFormat (    // Get current date format
  4631.       pFMTDate       pfmtDate
  4632.    );
  4633.  
  4634. DBIResult DBIFN DbiSetDateFormat (    // Set current date format
  4635.       pFMTDate       pfmtDate
  4636.    );
  4637.  
  4638. DBIResult DBIFN DbiGetTimeFormat (    // Get current time format
  4639.       pFMTTime       pfmtTime
  4640.    );
  4641.  
  4642. DBIResult DBIFN DbiSetTimeFormat (    // Set current time format
  4643.       pFMTTime       pfmtTime
  4644.    );
  4645.  
  4646. DBIResult DBIFN DbiGetNumberFormat (  // Get current number format
  4647.       pFMTNumber     pfmtNumber
  4648.    );
  4649.  
  4650. DBIResult DBIFN DbiSetNumberFormat (  // Set current number format
  4651.       pFMTNumber     pfmtNumber
  4652.    );
  4653.  
  4654. //============================================================================
  4655. //                      Conversions      
  4656. //============================================================================
  4657.  
  4658. DBIResult DBIFN DbiNativeToAnsi(      // Convert from native to Ansi
  4659.       pVOID    pLdObj  ,                // Language driver
  4660.       pCHAR    pAnsiStr,                // Destination buffer (opt)
  4661.       pCHAR    pNativeStr ,             // Source buffer
  4662.       UINT16   iLen    ,                // Length of buffer (opt)
  4663.       pBOOL    pbDataLoss               // Returns TRUE if conversion will loose data (opt)
  4664.    );
  4665.  
  4666. DBIResult DBIFN DbiAnsiToNative(      // Convert from Ansi to native
  4667.       pVOID pLdObj  ,                   // Language driver
  4668.       pCHAR    pNativeStr ,             // Destination buffer (opt)
  4669.       pCHAR    pAnsiStr,                // Source buffer
  4670.       UINT16   iLen    ,                // Length of buffer (opt)
  4671.       pBOOL    pbDataLoss               // Returns TRUE if conversion will loose data (opt)
  4672.    );
  4673.  
  4674. //============================================================================
  4675. //                            Filters
  4676. //============================================================================
  4677. #if !defined(MIDL)
  4678. DBIResult DBIFN DbiAddFilter(         // Add a filter to the cursor
  4679.       hDBICur           hCursor,        // Cursor handle
  4680.       UINT32            iClientData,    // Client supplied data      (opt)
  4681.       UINT16            iPriority,      // 1..N with 1 being highest (opt)
  4682.       BOOL              bCanAbort,      // TRUE if pfFiltercan return ABORT (opt)
  4683.       pCANExpr          pcanExpr,       // Expression tree        (opt)
  4684.       pfGENFilter       pfFilter,       // ptr to filter function (opt)
  4685.       phDBIFilter       phFilter        // Returns filter handle
  4686.    );
  4687. #endif // !defined(MIDL)
  4688.  
  4689. DBIResult DBIFN DbiDropFilter(        // Drop a filter
  4690.       hDBICur           hCursor,        // Cursor handle
  4691.       hDBIFilter        hFilter         // Filter handle
  4692.    );
  4693.  
  4694. DBIResult DBIFN DbiActivateFilter(    // Activate a Filter
  4695.       hDBICur           hCursor,        // Cursor handle
  4696.       hDBIFilter        hFilter         // Filter handle
  4697.    );
  4698.  
  4699. DBIResult DBIFN DbiDeactivateFilter(  // Deactivate Filter
  4700.       hDBICur           hCursor,        // Cursor handle
  4701.       hDBIFilter        hFilter         // Filter handle
  4702.    );
  4703.  
  4704. #if !defined(MIDL)
  4705. DBIResult DBIFN  DbiGetFilterInfo(    // Get filter information
  4706.       hDBICur           hCur    ,       // Cursor handle
  4707.       hDBIFilter        hFilter ,       // Filter handle          /NULL
  4708.       UINT16            iFilterId,      // Filter id              /0
  4709.       UINT16            iFilterSeqNo,   // Filter sequence number /0
  4710.       pFILTERInfo       pFilterinfo     // Returns filter info
  4711.   );
  4712. #endif // !defined(MIDL)
  4713.  
  4714. //============================================================================
  4715. //                            Linked Cursors
  4716. //============================================================================
  4717.  
  4718. DBIResult DBIFN DbiBeginLinkMode(     // Convert cursor to a link cursor
  4719.       phDBICur          phCursor        // In/Out : returns new cursor
  4720.     );
  4721.  
  4722. DBIResult DBIFN DbiEndLinkMode (      // Convert cursor back to normal cursor
  4723.       phDBICur       phCursor           // In/Out : returns original cursor
  4724.    );
  4725.  
  4726. DBIResult DBIFN DbiLinkDetail(        // Link detail to master
  4727.       hDBICur        hMstrCursor,       // Master cursor
  4728.       hDBICur        hDetlCursor,       // Detail cursor
  4729.       UINT16         iLnkFields,        // Number of link fields
  4730.       pUINT16        piMstrFields,      // Array of fields in master
  4731.       pUINT16        piDetlFields       // Array of fields in detail
  4732.     );
  4733.  
  4734. DBIResult DBIFN DbiLinkDetailToExp(   // Link detail to a master using exp
  4735.         hDBICur         hCursorMstr,    // Master cursor
  4736.         hDBICur         hCursorDetl,    // Detail cursor
  4737.         UINT16          iKeyLen,        // Key length to match
  4738.         pCHAR           pszMstrExp      // Expression string
  4739.     );
  4740.  
  4741. DBIResult DBIFN DbiUnlinkDetail (     // Unlink detail from master
  4742.       hDBICur        hDetlCursor        // Detail cursor to unlink
  4743.     );
  4744.  
  4745. DBIResult DBIFN DbiGetLinkStatus(     // Query linkage info for table
  4746.         hDBICur         hCursor,        // Cursor handle
  4747.         phDBICur        phCursorMstr,   // Returns master cursor, if any   (opt)
  4748.         phDBICur        phCursorDet,    // Returns first detail cursor, if any (opt)
  4749.         phDBICur        phCursorSib     // Returns next sibling detail cursor, if any (opt)
  4750.     );
  4751.  
  4752.  
  4753. //===========================================================================
  4754. //                            Translation
  4755. //===========================================================================
  4756.  
  4757.  
  4758. DBIResult DBIFN DbiTranslateRecordStructure ( // Translate a record
  4759.       pCHAR          pszSrcDriverType,  // Source driver type
  4760.       UINT16         iFlds,             // Number of fields
  4761.       pFLDDesc       pfldsSrc,          // Array of source fields: logical or physical types
  4762.       pCHAR          pszDstDriverType,  // Destination driver type
  4763.       pCHAR          pszLangDriver,     // Language driver for destination
  4764.       pFLDDesc       pfldsDst           // Array of dest. fields returned
  4765.    );
  4766.  
  4767. DBIResult DBIFN DbiOpenFieldXlt (     // Open translation object
  4768.       pCHAR          pszSrcTblType,     // NULL for Logical
  4769.       pCHAR          pszSrcLangDrv,     // NULL if no tranliteration 
  4770.       pFLDDesc       pfldSrc,           // source field descriptor
  4771.       pCHAR          pszDestTblType,    // NULL for Logical
  4772.       pCHAR          pszDstLangDrv,     // NULL if no tranliteration 
  4773.       pFLDDesc       pfldDest,          // Source field descriptor
  4774.       pBOOL          pbDataLoss,        // Set to TRUE, for data loss
  4775.       phDBIXlt       phXlt              // Returned translate handle
  4776.    );
  4777.  
  4778. DBIResult DBIFN DbiTranslateField (   // Translate a field
  4779.       hDBIXlt        hXlt,              // Translation handle
  4780.       pBYTE          pSrc,              // Source field
  4781.       pBYTE          pDest              // Destination field
  4782.    );
  4783.  
  4784. DBIResult DBIFN DbiCloseFieldXlt (    // Close translation object
  4785.       hDBIXlt        hXlt               // Translation handle
  4786.    );
  4787.  
  4788.  
  4789. //===========================================================================
  4790. //                                 MISC.
  4791. //===========================================================================
  4792.  
  4793.  
  4794. DBIResult DBIFN DbiGetTableOpenCount (   //  Get local cursor count
  4795.       hDBIDb         hDb,                    // Database
  4796.       pCHAR          pszTableName,           // Table name
  4797.       pCHAR          pszDriverType,          // Driver type /NULL
  4798.       pUINT16        piOpenCount             // returned number of cursors
  4799. );
  4800.  
  4801. DBIResult DBIFN DbiUseIdleTime (      // Use Idle time
  4802.       VOID
  4803.    );
  4804.  
  4805. DBIResult DBIFN DbiGetLdObj (         // Get language driver
  4806.       hDBICur        hCursor,           // Cursor handle
  4807.       pVOID         *ppLdObj            // Returned language driver object
  4808.    );
  4809.  
  4810. DBIResult DBIFN DbiGetLdName (        // Get language driver name from table
  4811.       pCHAR         pszDriver,          // Driver name
  4812.       pCHAR         pObjName,           // Name of object, i.e. table name
  4813.       pCHAR         pLdName             // Returned language driver name
  4814.    );
  4815.  
  4816. DBIResult DBIFN DbiFormFullName (     // Form Full Name
  4817.       hDBIDb         hDb,               // Database handle
  4818.       pCHAR          pszTableName,      // Table name
  4819.       pCHAR          pszDriverType,     // Driver type /NULL
  4820.       pCHAR          pszFullName        // Returns full name
  4821.    );
  4822.  
  4823. DBIResult DBIFN DbiAddPassword (      // Add a password to current session
  4824.       pCHAR          pszPassword        // Password
  4825.    );
  4826.  
  4827. DBIResult DBIFN DbiDropPassword (     // Drop a password from current session
  4828.       pCHAR          pszPassword        // password/NULL
  4829.    );
  4830.  
  4831. DBIResult DBIFN DbiGetNetUserName (   // Get network username
  4832.       pCHAR          pszNetUserName     // Returns username
  4833.    );
  4834.  
  4835.  
  4836. DBIResult DBIFN DbiDebugLayerOptions (// Get SDK debug layer options
  4837.       UINT16         iOption,           // Option
  4838.       pCHAR          pDebugFile         // 
  4839.    );
  4840.  
  4841. DBIResult DBIFN DbiOpenCfgInfoList (  // Open a cursor on "Config"
  4842.       hDBICfg        hCfg,              // NULL
  4843.       DBIOpenMode    eOpenMode,         // ReadWrite or readonly
  4844.       CFGMode        eConfigMode,       // Config mode
  4845.       pCHAR          pszCfgPath,        // Path
  4846.       phDBICur       phCur              // Returned cursor
  4847.   );
  4848.  
  4849. DBIResult DBIFN DbiAddAlias (         // Add a new alias
  4850.       hDBICfg        hCfg,              // NULL
  4851.       pCHAR          pszAliasName,      // Alias name
  4852.       pCHAR          pszDriverType,     // Driver type for alias
  4853.       pCHAR          pszParams,         // Optional parameters
  4854.       BOOL           bPersist           // Persistent or session relative
  4855.   );
  4856.  
  4857. DBIResult DBIFN DbiDeleteAlias (      // Add a new alias
  4858.       hDBICfg        hCfg,              // NULL
  4859.       pCHAR          pszAliasName       // Alias name
  4860.   );
  4861.  
  4862.  
  4863.  
  4864. #ifndef NODBIQBE
  4865. //===========================================================================
  4866. //                      Query Management
  4867. //===========================================================================
  4868.  
  4869. DBIResult DBIFN DbiQExecDirect (      // Execute query
  4870.       hDBIDb         hDb,               // Database handle
  4871.       DBIQryLang     eQryLang,          // Query language
  4872.       pCHAR          pszQuery,          // Query 
  4873.       phDBICur       phCur              // Returned cursor on result set
  4874.    );
  4875.  
  4876. DBIResult DBIFN DbiQPrepare (         // Prepare a query
  4877.       hDBIDb         hDb,               // Database handle
  4878.       DBIQryLang     eQryLang,          // Query language
  4879.       pCHAR          pszQuery,          // Query
  4880.       phDBIStmt      phStmt             // Returned statment handle
  4881.    );
  4882.  
  4883. DBIResult DBIFN DbiQPrepareExt (      // Prepare a query
  4884.       hDBIDb         hDb,               // Database handle
  4885.       DBIQryLang     eQryLang,          // Query language
  4886.       pCHAR          pszQuery,          // Query
  4887.       UINT16         propBits,          // properties for Prepare, e.g. qprepFORUPDATE
  4888.       phDBIStmt      phStmt             // Returned statment handle
  4889.    );
  4890.  
  4891. DBIResult DBIFN DbiQExec (            // Execute prepared query
  4892.       hDBIStmt       hStmt,             // Statement handle
  4893.       phDBICur       phCur              // Returned handle on result set
  4894.    );
  4895.  
  4896. DBIResult DBIFN DbiQFree (            // Free statement handle
  4897.       phDBIStmt      phStmt             // Statement handle
  4898.    );
  4899.  
  4900. DBIResult DBIFN DbiQSetParams (       // Set query options
  4901.       hDBIStmt       hStmt,             // Statement handle
  4902.       UINT16         uFldDescs,         // Number of parameter field descriptors
  4903.       pFLDDesc       paFldDescs,        // Array of parameter field descriptors
  4904.       pBYTE          pRecBuff           // Record buffer
  4905.    );
  4906.  
  4907. DBIResult DBIFN DbiQInstantiateAnswer ( // Create answer table
  4908.       hDBIStmt   hStmt,                 // Statement Handle
  4909.       hDBICur    hCur,                  // Cursor Handle
  4910.       pCHAR      pszAnswerName,         // Answer Table Name/NULL
  4911.       pCHAR      pszAnswerType,         // Answer Table Type/NULL
  4912.       BOOL       bOverWrite,            // Overwrite Flag
  4913.       phDBICur   phCur                  // cursor to instantiated table (output)(optional)
  4914.    );
  4915.  
  4916. DBIResult DBIFN DbiQExecProcDirect (    // Direct execution of stored procedure
  4917.       hDBIDb         hDb,               // Database handle
  4918.       pCHAR          pszProc,           // Stored procedure name
  4919.       UINT16         uParamDescs,       // Number of parameter descriptors
  4920.       pSPParamDesc   paParamDescs,      // Array of parameter descriptors
  4921.       pBYTE          pRecBuff,          // Record buffer
  4922.       phDBICur       phCur              // Returned handle on result set
  4923.    );
  4924.  
  4925. DBIResult DBIFN DbiQPrepareProc (       // Prepare a stored procedure
  4926.       hDBIDb         hDb,               // Database handle
  4927.       pCHAR          pszProc,           // Stored procedure name
  4928.       UINT16         uParamDescs,       // Number of parameter descriptors
  4929.       pSPParamDesc   paParamDescs,      // Array of parameter descriptors
  4930.       pBYTE          pRecBuff,          // Record buffer
  4931.       phDBIStmt      phStmt             // Returned statment handle
  4932.    );
  4933.  
  4934. DBIResult DBIFN DbiQSetProcParams (     // Set procedure params
  4935.       hDBIStmt       hStmt,             // Statement handle
  4936.       UINT16         uParamDescs,       // Number of parameter descriptors
  4937.       pSPParamDesc   paParamDescs,      // Array of parameter descriptors
  4938.       pBYTE          pRecBuff           // Record buffer
  4939.    );
  4940.  
  4941. #endif  // NODBIQBE
  4942.  
  4943. #endif  // NODBIPROTOTYPES
  4944.  
  4945. #ifdef __cplusplus
  4946.    }
  4947. #endif // __cplusplus
  4948.  
  4949. #if ! (defined(lint) || defined(_lint))
  4950. #  if ( _MSC_VER >= 800 ) || (defined(__BORLANDC__) && defined(__FLAT__))
  4951. #    pragma warning(disable:4103)
  4952. #    if !(defined( MIDL_PASS )) || defined( __midl )
  4953. #      pragma pack(pop)
  4954. #    else
  4955. #      pragma pack()
  4956. #    endif
  4957. #  elif defined(__BORLANDC__) && !defined(__FLAT__)
  4958. #    pragma option -a.
  4959. #  else
  4960. #    pragma pack()
  4961. #  endif
  4962. #endif // ! (defined(lint) || defined(_lint))
  4963.  
  4964. #endif
  4965.  
  4966. 
  4967.