home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Runimage / Delphi50 / Doc / BDE.INT next >
Encoding:
Text File  |  1999-08-11  |  283.2 KB  |  7,043 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Borland Delphi Visual Component Library         }
  5. {       BDE Interface Unit                              }
  6. {                                                       }
  7. {       Copyright (c) 1995,99 Inprise Corporation       }
  8. {                                                       }
  9. {*******************************************************}
  10.  
  11. unit Bde;
  12.  
  13. {$Z+}
  14.  
  15. interface
  16.  
  17. uses Windows;
  18.  
  19. { Translated from IDAPI.H,  Revision 4.203 }
  20.  
  21. const
  22.   DBIINTFVER         = 500;             { Version of the interface }
  23.   DBIENGVERSION      = 500;             { Version of the engine }
  24.  
  25. {-----------------------------------------------------------------------}
  26. {     DBI types                                                         }
  27. {-----------------------------------------------------------------------}
  28.  
  29.  
  30. { sdk debug layer defines }
  31.  
  32. const
  33.   DEBUGON            = $1;
  34.   OUTPUTTOFILE       = $2;
  35.   FLUSHEVERYOP       = $8;
  36.   APPENDTOLOG        = $10;
  37.  
  38. { Constants }
  39.  
  40.   DBIMAXNAMELEN      = 31;              { Name limit (table, field etc) }
  41.   DBIMAXSPNAMELEN    = 64;              { Max stored procedure name length }
  42.   DBIMAXFUNCNAMELEN  = 255;             { Max function name len }
  43.   DBIMAXFLDSINKEY    = 16;              { Max fields in a key }
  44.   DBIMAXKEYEXPLEN    = 220;             { Max Key expression length }
  45.   DBIMAXEXTLEN       = 3;               { Max file extension len, not incl. dot (excluding zero termination) }
  46.   DBIMAXTBLNAMELEN   = 260;             { Max table name length }
  47.   DBIMAXDRIVELEN     = 127;             { Max drive length }
  48.   DBIMAXPATHLEN      = 260;             { Max path+file name len (excluding zero termination) }
  49.   DBIMAXMSGLEN       = 127;             { Max message len }
  50.   DBIMAXVCHKLEN      = 255;             { Max val check len }
  51.   DBIMAXPICTLEN      = 175;             { Max picture len }
  52.   DBIMAXFLDSINSEC    = 256;             { Max fields in security spec }
  53.  
  54.   DBIMAXSCFIELDS     = 40;              { max nbr of fields in a config section }
  55.   DBIMAXSCFLDLEN     = 128;             { max field length }
  56.   DBIMAXSCRECSIZE    = DBIMAXSCFIELDS*DBIMAXSCFLDLEN; { max rec size }
  57.  
  58.   DBIMAXUSERNAMELEN  = 14;              { Max user name (general) }
  59.   DBIMAXXBUSERNAMELEN = 16;             { Max user name length (xBASE) }
  60.   DBIMAXBOOKMARKLEN  = 4104;            { Max Bookmark length }
  61.  
  62.   DBIMAXTRACELEN     = 8192;            { Max trace msg len }
  63.  
  64.   DBIMAXTYPEDESC     = 127;             { Max Type Description size }
  65.   DBIMAXDRSQLSTR     = 8192;            { Max Size of SQL Constraint }
  66.  
  67.   DBIMAXOLEDBNAMELEN = 64;              { Max OLE DB name length }
  68.  
  69. {============================================================================}
  70. {                             G e n e r a l                                  }
  71. {============================================================================}
  72.  
  73. type
  74.   DBIDATE            = Longint;
  75.   TIME               = Longint;
  76.   TIMESTAMP          = Double;
  77.   DBIResult          = Word;         { Function result }
  78.   TypedEnum          = Integer;
  79.   PLocale            = Pointer;
  80.  
  81. { Handle Types }
  82.  
  83.   _hDBIObj           = record end;      { Dummy structure to create "typed" handles }
  84.   hDBIObj            = ^_hDBIObj;       { Generic object handle }
  85.   hDBIDb             = ^_hDBIObj;       { Database handle }
  86.   hDBIQry            = ^_hDBIObj;       { Query handle }
  87.   hDBIStmt           = ^_hDBIObj;       { Statement handle ("new query") }
  88.   hDBICur            = ^_hDBIObj;       { Cursor handle }
  89.   hDBISes            = ^_hDBIObj;       { Session handle }
  90.   hDBIXlt            = ^_hDBIObj;       { Translation handle }
  91.   hDBICfg            = ^_hDBIObj;       { Configuration handle }
  92.   hDBIXact           = ^_hDBIObj;       { Transaction handle }
  93.   hDBIFilter         = ^_hDBIObj;       { Filter handle }
  94.   hDBIDR             = ^_hDBIObj;       { Handle to a Client Data Repository (CDR) Object }
  95.  
  96.  
  97. { Handle Pointers }
  98.  
  99.   phDBIObj           = ^hDBIObj;        { Pointer to Generic object handle }
  100.   phDBIDb            = ^hDBIDb;         { Pointer to Database handle }
  101.   phDBIQry           = ^hDBIQry;        { Pointer to Query handle }
  102.   phDBIStmt          = ^hDBIStmt;       { Pointer to Statement handle }
  103.   phDBICur           = ^hDBICur;        { Pointer to Cursor handle }
  104.   phDBISes           = ^hDBISes;        { Pointer to Session handle }
  105.   phDBIXlt           = ^hDBIXlt;        { Pointer to Translation handle }
  106.   phDBICfg           = ^hDBICfg;        { Pointer to Configuration handle }
  107.   phDBIXact          = ^hDBIXact;       { Pointer to Transaction handle }
  108.   phDBIFilter        = ^hDBIFilter;     { Pointer to Filter handle }
  109.   phDBIDR            = ^hDBIDR;         { Pointer to CDR Handle }
  110.  
  111. { typedefs for buffers of various common sizes: }
  112.  
  113.   DBIPATH            = packed array [0..DBIMAXPATHLEN] of Char; { holds a DOS path }
  114.   DBINAME            = packed array [0..DBIMAXNAMELEN] of Char; { holds a name }
  115.   DBIEXT             = packed array [0..DBIMAXEXTLEN] of Char; { holds an extension EXT }
  116.   DBIDOTEXT          = packed array [0..DBIMAXEXTLEN+1] of Char; { holds an extension EXT including '.' }
  117.   DBIDRIVE           = packed array [0..DBIMAXDRIVELEN] of Char; { holds a drive name }
  118.   DBITBLNAME         = packed array [0..DBIMAXTBLNAMELEN] of Char; { holds a table name }
  119.   DBISPNAME          = packed array [0..DBIMAXSPNAMELEN] of Char; { holds a stored procedure name }
  120.   DBIUSERNAME        = packed array [0..DBIMAXUSERNAMELEN] of Char; { holds a user name }
  121.   DBIKEY             = packed array [0..DBIMAXFLDSINKEY-1] of Word; { holds list of fields in a key }
  122.   DBIKEYEXP          = packed array [0..DBIMAXKEYEXPLEN] of Char; { holds a key expression }
  123.   DBIVCHK            = packed array [0..DBIMAXVCHKLEN] of Byte; { holds a validity check }
  124.   DBIPICT            = packed array [0..DBIMAXPICTLEN] of Char; { holds a picture (Pdox) }
  125.   DBIMSG             = packed array [0..DBIMAXMSGLEN] of Char; { holds an error message }
  126.   DBIDRTYPEDESC      = packed array [0..DBIMAXTYPEDESC] of Char; { holds a Type Description string }
  127.   DBISQLSTR          = packed array [0..DBIMAXDRSQLSTR] of Char; { a SQL string }
  128.  
  129.  
  130. {============================================================================}
  131. {                             Environmental                                  }
  132. {============================================================================}
  133.  
  134. type
  135.   pDBIEnv = ^DBIEnv;
  136.   DBIEnv = packed record                { Struct for defining the environ. }
  137.     szWorkDir       : DBIPATH;          { Working directory }
  138.     szIniFile       : DBIPATH;          { Configuration file }
  139.     bForceLocalInit : WordBool;         { Force local initialization }
  140.     szLang          : DBINAME;          { System language driver }
  141.     szClientName    : DBINAME;          { Client name (documentary) }
  142.   end;
  143.  
  144. {============================================================================}
  145. {                   System Info                                              }
  146. {============================================================================}
  147.  
  148. type
  149.   pSYSVersion = ^SYSVersion;
  150.   SYSVersion = packed record            { System Version Info }
  151.     iVersion        : Word;             { Engine version }
  152.     iIntfLevel      : Word;             { Client Interface level }
  153.     dateVer         : DBIDATE;          { Version date (Compile/Release) }
  154.     timeVer         : Time;             { Version time (Compile/Release) }
  155.     szVersion       : array [0..19] of Char; { Version name (xxx.xxx.xxx.xxx) }
  156.   end;
  157.  
  158.   pSYSConfig = ^SYSConfig;
  159.   SYSConfig = packed record             { System configuration (basic) }
  160.     bLocalShare     : WordBool;         { If Local files will be shared }
  161.     iNetProtocol    : Word;             { Net Protocol (35, 40 etc.) }
  162.     bNetShare       : WordBool;         { If Net files will be shared }
  163.     szNetType       : DBINAME;          { Network type }
  164.     szUserName      : DBIUSERNAME;      { Network user name }
  165.     szIniFile       : DBIPATH;          { Configuration file }
  166.     szLangDriver    : DBINAME;          { System language driver }
  167.   end;
  168.  
  169.   pSYSInfo = ^SYSInfo;
  170.   SYSInfo = packed record               { System Status/Info }
  171.     iBufferSpace    : Word;             { in K }
  172.     iHeapSpace      : Word;             { in K }
  173.     iDrivers        : Word;             { Active/Loaded drivers }
  174.     iClients        : Word;             { Active clients }
  175.     iSessions       : Word;             { Number of sessions (For all clients) }
  176.     iDatabases      : Word;             { Open databases }
  177.     iCursors        : Word;             { Number of cursors }
  178.   end;
  179.  
  180.   pCLIENTInfo = ^CLIENTInfo;
  181.   CLIENTInfo = packed record
  182.     szName          : DBINAME;          { Documentary name }
  183.     iSessions       : Word;             { Number of sessions }
  184.     szWorkDir       : DBIPATH;          { Working directory }
  185.     szLang          : DBINAME;          { System language driver (Client supplied) }
  186.   end;
  187.  
  188.   pSESInfo = ^SESInfo;
  189.   SESInfo = packed record
  190.     iSession        : Word;             { Session id (1..n) }
  191.     szName          : DBINAME;          { Documentary name }
  192.     iDatabases      : Word;             { Open databases }
  193.     iCursors        : Word;             { Open cursors }
  194.     iLockWait       : SmallInt;         { Lock wait time (in seconds) }
  195.     szNetDir        : DBIPATH;          { Net directory location }
  196.     szPrivDir       : DBIPATH;          { Current Private directory }
  197.   end;
  198.  
  199. {============================================================================}
  200. {                             Table / Field Types                            }
  201. {============================================================================}
  202.  
  203. { Driver Types }
  204.  
  205. const
  206.   szPARADOX          = 'PARADOX';
  207.   szDBASE            = 'DBASE';
  208.   szFOXPRO           = 'FOXPRO';
  209.   szASCII            = 'ASCIIDRV';
  210.   szOLEDB            = 'OLEDBDRV';
  211.   szMSACCESS         = 'MSACCESS'; 
  212.  
  213.  
  214. { Field Types (Logical) }
  215.  
  216.   fldUNKNOWN         = 0;
  217.   fldZSTRING         = 1;               { Null terminated string }
  218.   fldDATE            = 2;               { Date     (32 bit) }
  219.   fldBLOB            = 3;               { Blob }
  220.   fldBOOL            = 4;               { Boolean  (16 bit) }
  221.   fldINT16           = 5;               { 16 bit signed number }
  222.   fldINT32           = 6;               { 32 bit signed number }
  223.   fldFLOAT           = 7;               { 64 bit floating point }
  224.   fldBCD             = 8;               { BCD }
  225.   fldBYTES           = 9;               { Fixed number of bytes }
  226.   fldTIME            = 10;              { Time        (32 bit) }
  227.   fldTIMESTAMP       = 11;              { Time-stamp  (64 bit) }
  228.   fldUINT16          = 12;              { Unsigned 16 bit integer }
  229.   fldUINT32          = 13;              { Unsigned 32 bit integer }
  230.   fldFLOATIEEE       = 14;              { 80-bit IEEE float }
  231.   fldVARBYTES        = 15;              { Length prefixed var bytes }
  232.   fldLOCKINFO        = 16;              { Look for LOCKINFO typedef }
  233.   fldCURSOR          = 17;              { For Oracle Cursor type }
  234.   fldINT64           = 18;              { 64 bit signed number }
  235.   fldUINT64          = 19;              { Unsigned 64 bit integer }
  236.   fldADT             = 20;              { Abstract datatype (structure) }
  237.   fldARRAY           = 21;              { Array field type }
  238.   fldREF             = 22;              { Reference to ADT }
  239.   fldTABLE           = 23;              { Nested table (reference) }
  240.  
  241.   MAXLOGFLDTYPES     = 24;              { Number of logical fieldtypes }
  242.  
  243. { Sub Types (Logical) }
  244.  
  245. { fldFLOAT subtype }
  246.  
  247.   fldstMONEY         = 21;              { Money }
  248.  
  249. { fldBLOB subtypes }
  250.  
  251.   fldstMEMO          = 22;              { Text Memo }
  252.   fldstBINARY        = 23;              { Binary data }
  253.   fldstFMTMEMO       = 24;              { Formatted Text }
  254.   fldstOLEOBJ        = 25;              { OLE object (Paradox) }
  255.   fldstGRAPHIC       = 26;              { Graphics object }
  256.   fldstDBSOLEOBJ     = 27;              { dBASE OLE object }
  257.   fldstTYPEDBINARY   = 28;              { Typed Binary data }
  258.   fldstACCOLEOBJ     = 30;              { Access OLE object }
  259.   fldstHMEMO         = 33;              { CLOB }
  260.   fldstHBINARY       = 34;              { BLOB }
  261.   fldstBFILE         = 36;              { BFILE }
  262.  
  263. { fldZSTRING subtype }
  264.  
  265.   fldstPASSWORD      = 1;               { Password }
  266.   fldstFIXED         = 31;              { CHAR type }
  267.   fldstUNICODE       = 32;              { Unicode }
  268.  
  269. { fldINT32 subtype }
  270.  
  271.   fldstAUTOINC       = 29;
  272.  
  273. { fldADT subtype }
  274.  
  275.   fldstADTNestedTable = 35;             { ADT for nested table (has no name) }
  276.  
  277. { fldDATE subtype }
  278.   fldstADTDATE       = 37;              { DATE (OCIDate ) with in an ADT }
  279.  
  280. { Paradox types (Physical) }
  281.  
  282.   fldPDXCHAR         = $101;            { Alpha    (string) }
  283.   fldPDXNUM          = $102;            { Numeric }
  284.   fldPDXMONEY        = $103;            { Money }
  285.   fldPDXDATE         = $104;            { Date }
  286.   fldPDXSHORT        = $105;            { Short }
  287.   fldPDXMEMO         = $106;            { Text Memo       (blob) }
  288.   fldPDXBINARYBLOB   = $107;            { Binary data     (blob) }
  289.   fldPDXFMTMEMO      = $108;            { Formatted text  (blob) }
  290.   fldPDXOLEBLOB      = $109;            { OLE object      (blob) }
  291.   fldPDXGRAPHIC      = $10A;            { Graphics object (blob) }
  292.   fldPDXBLOB         = fldPDXMEMO;
  293.   fldPDXLONG         = $10B;            { Long }
  294.   fldPDXTIME         = $10C;            { Time }
  295.   fldPDXDATETIME     = $10D;            { Time Stamp }
  296.   fldPDXBOOL         = $10E;            { Logical }
  297.   fldPDXAUTOINC      = $10F;            { Auto increment (long) }
  298.   fldPDXBYTES        = $110;            { Fixed number of bytes }
  299.   fldPDXBCD          = $111;            { BCD (32 digits) }
  300.   fldPDXUNICHAR      = $112;            { not supported yet }
  301.  
  302. { xBASE types (Physical) }
  303.  
  304.   fldDBCHAR          = $201;            { Char string }
  305.   fldDBNUM           = $202;            { Number }
  306.   fldDBMEMO          = $203;            { Memo          (blob) }
  307.   fldDBBOOL          = $204;            { Logical }
  308.   fldDBDATE          = $205;            { Date }
  309.   fldDBFLOAT         = $206;            { Float }
  310.   fldDBLOCK          = $207;            { Logical type is LOCKINFO }
  311.   fldDBOLEBLOB       = $208;            { OLE object    (blob) }
  312.   fldDBBINARY        = $209;            { Binary data   (blob) }
  313.   fldDBBYTES         = $20A;            { Only for TEMPORARY tables }
  314.   fldDBLONG          = $20B;            { Long (Integer) }
  315.   fldDBDATETIME      = $20C;            { DateTime }
  316.   fldDBDOUBLE        = $20D;            { Double }
  317.   fldDBAUTOINC       = $20E;            { Auto increment (long) }
  318.  
  319. { xBASE key types (Cannot be used as field types) }
  320.  
  321.   fldDBKEYNUM        = $210;
  322.   fldDBKEYBCD        = $211;
  323.  
  324.  
  325. { Ascii types (Physical) }
  326.  
  327.   fldASCCHAR         = $301;            { Char string }
  328.   fldASCNUM          = $302;            { Number }
  329.   fldASCBOOL         = $303;            { Logical }
  330.   fldASCDATE         = $304;            { Date }
  331.   fldASCFLOAT        = $305;            { Float }
  332.   fldASCLOCK         = $306;            { Not used }
  333.   fldASCTIMESTAMP    = $307;            { TimeStamp }
  334.   fldASCTIME         = $308;            { Time }
  335.   fldASCLONG         = $309;            { Long }
  336.   fldASCMONEY        = $30A;            { Money }
  337.  
  338. { MS Access types (Physical) }
  339.  
  340.   fldACCCHAR         = $701;            { Fixed length Character }
  341.   fldACCVARCHAR      = $702;            { Variable length Character }
  342.   fldACCDATETIME     = $703;            { Date/Time }
  343.   fldACCBIT          = $704;            { Boolean }
  344.   fldACCMONEY        = $705;            { Currency }
  345.   fldACCSHORT        = $706;            { Short }
  346.   fldACCLONG         = $707;            { Long }
  347.   fldACCFLOAT        = $708;            { Float }
  348.   fldACCLONGTEXT     = $709;            { Memo }
  349.   fldACCLONGBINARY   = $70A;            { OLE Object }
  350.   fldACCAUTOINC      = $70B;            { Auto Number }
  351.   fldACCBYTE         = $70C;            { Byte }
  352.   fldACCDOUBLE       = $70D;            { Double }
  353.   fldACCBINARY       = $70E;            { Binary }
  354.   fldACCGUID         = $70F;            { Replication ID }
  355.  
  356.  
  357. {============================================================================}
  358. {                    Field descriptor                                        }
  359. {============================================================================}
  360.  
  361.  
  362. type
  363.   FLDVchk = (                           { Field Val Check type }
  364.     fldvNOCHECKS,                       { Does not have explicit val checks }
  365.     fldvHASCHECKS,                      { One or more val checks on the field }
  366.     fldvUNKNOWN                         { Dont know at this time }
  367.   );
  368.  
  369. type
  370.   FLDRights = (                         { Field Rights }
  371.     fldrREADWRITE,                      { Field can be Read/Written }
  372.     fldrREADONLY,                       { Field is Read only }
  373.     fldrNONE,                           { No Rights on this field }
  374.     fldrUNKNOWN                         { Dont know at this time }
  375.   );
  376.  
  377. type
  378.   pFLDDesc = ^FLDDesc;
  379.   FLDDesc = packed record               { Field Descriptor }
  380.     iFldNum         : Word;             { Field number (1..n) }
  381.     szName          : DBINAME;          { Field name }
  382.     iFldType        : Word;             { Field type }
  383.     iSubType        : Word;             { Field subtype (if applicable) }
  384.     iUnits1         : SmallInt;         { Number of Chars, digits etc }
  385.     iUnits2         : SmallInt;         { Decimal places etc. }
  386.     iOffset         : Word;             { Offset in the record (computed) }
  387.     iLen            : Word;             { Length in bytes (computed) }
  388.     iNullOffset     : Word;             { For Null bits (computed) }
  389.     efldvVchk       : FLDVchk;          { Field Has vcheck (computed) }
  390.     efldrRights     : FLDRights;        { Field Rights (computed) }
  391.     bCalcField      : WordBool;         { Is Calculated field (computed) }
  392.     iUnUsed         : packed array [0..1] of Word;
  393.   end;
  394.  
  395. { ============================================================================ }
  396. {                    Blob parameter descriptor                                 }
  397. { ============================================================================ }
  398.  
  399. type
  400.   pBLOBParamDesc = ^BLOBParamDesc;
  401.   BLOBParamDesc = packed record
  402.     pBlobBuffer     : Pointer;          { Blob buffer (client) }
  403.     ulBlobLen       : Integer;          { Length of the blob }
  404.     iUnUsed         : packed array[0..3] of Word;
  405.   end;
  406.  
  407. {============================================================================}
  408. {                    Index descriptor                                        }
  409. {============================================================================}
  410.  
  411. const
  412.   mdxDISTINCT      = $0020;         { OR with bUnique for dBASE distinct tags }
  413.  
  414. type
  415.   pIDXDesc = ^IDXDesc;
  416.   IDXDesc = packed record               { Index description }
  417.     szName          : DBITBLNAME;       { Index name }
  418.     iIndexId        : Word;             { Index number }
  419.     szTagName       : DBINAME;          { Tag name (for dBASE) }
  420.     szFormat        : DBINAME;          { Optional format (BTREE, HASH etc) }
  421.     bPrimary        : WordBool;         { True, if primary index }
  422.     bUnique         : WordBool;         { True, if unique keys (TRI-STATE for dBASE) }
  423.     bDescending     : WordBool;         { True, for descending index }
  424.     bMaintained     : WordBool;         { True, if maintained index }
  425.     bSubset         : WordBool;         { True, if subset index }
  426.     bExpIdx         : WordBool;         { True, if expression index }
  427.     iCost           : Word;             { Not used }
  428.     iFldsInKey      : Word;             { Fields in the key (1 for Exp) }
  429.     iKeyLen         : Word;             { Phy Key length in bytes (Key only) }
  430.     bOutofDate      : WordBool;         { True, if index out of date }
  431.     iKeyExpType     : Word;             { Key type of Expression }
  432.     aiKeyFld        : DBIKEY;           { Array of field numbers in key }
  433.     szKeyExp        : DBIKEYEXP;        { Key expression }
  434.     szKeyCond       : DBIKEYEXP;        { Subset condition }
  435.     bCaseInsensitive : WordBool;        { True, if case insensitive index }
  436.     iBlockSize      : Word;             { Block size in bytes }
  437.     iRestrNum       : Word;             { Restructure number }
  438.     abDescending    : packed array [0..DBIMAXFLDSINKEY-1] of WordBool; { TRUE }
  439.     iUnUsed         : packed array [0..15] of Word;
  440.   end;
  441.  
  442. {============================================================================}
  443. {             Validity check, Referential integrity descriptors              }
  444. {============================================================================}
  445.  
  446.  
  447.  
  448. { Subtypes for Lookup }
  449.  
  450.   LKUPType = (                          { Paradox Lookup type }
  451.     lkupNONE,                           { Has no lookup }
  452.     lkupPRIVATE,                        { Just Current Field + Private }
  453.     lkupALLCORRESP,                     { All Corresponding + No Help }
  454.     lkupHELP,                           { Just Current Fld + Help and Fill }
  455.     lkupALLCORRESPHELP                  { All Corresponging + Help }
  456.   );
  457.  
  458. const
  459.   TODAYVAL           = 2;               { for Min/Max/Def val flags }
  460.   NOWVAL             = 3;               { for Min/Max/Def val flags }
  461.  
  462.    { In VCHKDesc below, if any of bHasMinVal/bHasMaxVal/bHasDefVal }
  463.    { = TODAYVAL, then TODAY is assumed , = NOWVAL, then current time/today is assumed }
  464.  
  465. type
  466.   pVCHKDesc = ^VCHKDesc;
  467.   VCHKDesc = packed record              { Val Check structure }
  468.     iFldNum         : Word;             { Field number }
  469.     bRequired       : WordBool;         { If True, value is required }
  470.     bHasMinVal      : WordBool;         { If True, has min value }
  471.     bHasMaxVal      : WordBool;         { If True, has max value }
  472.     bHasDefVal      : WordBool;         { If True, has default value }
  473.     aMinVal         : DBIVCHK;          { Min Value }
  474.     aMaxVal         : DBIVCHK;          { Max Value }
  475.     aDefVal         : DBIVCHK;          { Default value }
  476.     szPict          : DBIPICT;          { Picture string }
  477.     elkupType       : LKUPType;         { Lookup/Fill type }
  478.     szLkupTblName   : DBIPATH;          { Lookup Table name }
  479.   end;
  480.  
  481.   RINTType = (                          { Ref integrity type }
  482.     rintMASTER,                         { This table is Master }
  483.     rintDEPENDENT                       { This table is Dependent }
  484.   );
  485.  
  486.   RINTQual = (                          { Ref integrity action/qualifier }
  487.     rintRESTRICT,                       { Prohibit operation }
  488.     rintCASCADE                         { Cascade operation }
  489.   );
  490.  
  491.   pRINTDesc = ^RINTDesc;
  492.   RINTDesc = packed record              { Ref Integrity Desc }
  493.     iRintNum        : Word;             { Ref integrity number }
  494.     szRintName      : DBINAME;          { A name to tag this integegrity constraint }
  495.     eType           : RINTType;         { Whether master/dependent }
  496.     szTblName       : DBIPATH;          { Other table name }
  497.     eModOp          : RINTQual;         { Modify qualifier }
  498.     eDelOp          : RINTQual;         { Delete qualifier }
  499.     iFldCount       : Word;             { Fields in foreign key }
  500.     aiThisTabFld    : DBIKEY;           { Fields in this table }
  501.     aiOthTabFld     : DBIKEY;           { Fields in other table }
  502.   end;
  503.  
  504.  
  505. {============================================================================}
  506. {                    Security descriptor                                     }
  507. {============================================================================}
  508. { Family rights }
  509.  
  510. const
  511.   NOFAMRIGHTS        = $00;             { No Family rights }
  512.   FORMRIGHTS         = $01;             { Can change form }
  513.   RPTRIGHTS          = $02;             { Can change reports }
  514.   VALRIGHTS          = $04;             { Can change valchecks }
  515.   SETRIGHTS          = $08;             { Can change settings }
  516.   ALLFAMRIGHTS       = (FORMRIGHTS or RPTRIGHTS or VALRIGHTS or SETRIGHTS);
  517.                                              { All family rights }
  518.  
  519. type
  520.   PRVType = TypedEnum;
  521. const
  522.     prvNONE      = 0;                   { No privilege }
  523.     prvREADONLY  = 1;                   { Read only Table or Field }
  524.     prvMODIFY    = 3;                   { Read and Modify fields (non-key) }
  525.     prvINSERT    = 7;                   { Insert + All of above }
  526.     prvINSDEL    = $0F;                 { Delete + All of above }
  527.     prvFULL      = $1F;                 { Full Writes }
  528.     prvUNKNOWN   = $FF;                 { Unknown }
  529.  
  530. type
  531.   pSECDesc = ^SECDesc;
  532.   SECDesc = packed record               { Security description }
  533.     iSecNum         : Word;             { Nbr to identify desc }
  534.     eprvTable       : PrvType;          { Table privileges }
  535.     iFamRights      : Word;             { Family rights }
  536.     szPassword      : DBINAME;          { Null terminated string }
  537.     aprvFld         : packed array [0..DBIMAXFLDSINSEC-1] of PrvType;
  538.                      { Field level privileges (prvNONE/prvREADONLY/prvFULL) }
  539.   end;
  540.  
  541. {============================================================================}
  542. {                            Miscellaneous                                   }
  543. {============================================================================}
  544.  
  545. { Index Id used to open table without a default index (i.e. no order) }
  546.  
  547. const
  548.   NODEFAULTINDEX     = $FFFF;
  549.  
  550.  
  551. {============================================================================}
  552. {                    Object types                                            }
  553. {============================================================================}
  554.  
  555. type
  556.   DBIOBJType = (
  557.     objFILLER,                          { Filler to make next start at 1 }
  558.     objSYSTEM,                          { System object }
  559.     objSESSION,                         { Session object }
  560.     objDRIVER,                          { Driver object }
  561.     objDATABASE,                        { Database object }
  562.     objCURSOR,                          { Cursor object }
  563.     objSTATEMENT,                       { Statement object }
  564.     objCLIENT,                          { Client object }
  565.     objDBSEC,                           { DbSystem object (dBASE only) }
  566.     objREPOSITORY                       { Data Repository object }
  567.   );
  568.  
  569.   pObjAttrDesc = ^ObjAttrDesc;
  570.   ObjAttrDesc = packed record
  571.     iFldNum    : Word;                  { Field id }
  572.     pszAttributeName : PChar;           { Object attribute name }
  573.   end;
  574.  
  575.   pObjTypeDesc = ^ObjTypeDesc;
  576.   ObjTypeDesc = packed record
  577.     iFldNum    : Word;                  { Field id }
  578.     szTypeName : DBINAME;               { Object type name }
  579.   end;
  580.  
  581.   pObjParentDesc = ^ObjParentDesc;
  582.   ObjParentDesc = packed record
  583.     iFldNum    : Word;                  { Field id }
  584.     iParentFldNum : Word;               { Parent Field id }
  585.   end;
  586.   
  587. {============================================================================}
  588. {                    Cursor properties                                       }
  589. {============================================================================}
  590.  
  591. type
  592.   DBIShareMode = (                      { Database/Table Share type }
  593.     dbiOPENSHARED,                      { Open shared  (Default) }
  594.     dbiOPENEXCL                         { Open exclusive }
  595.   );
  596.  
  597.   DBIOpenMode = (                       { Database/Table Access type }
  598.     dbiREADWRITE,                       { Read + Write   (Default) }
  599.     dbiREADONLY                         { Read only }
  600.   );
  601.  
  602.   DBILockType = (                       { Lock types (Table level) }
  603.     dbiNOLOCK,                          { No lock   (Default) }
  604.     dbiWRITELOCK,                       { Write lock }
  605.     dbiREADLOCK                         { Read lock }
  606.   );
  607.  
  608.   XLTMode = (                           { Field translate mode }
  609.     xltNONE,                            { No translation  (Physical Types) }
  610.     xltRECORD,                          { Record level translation (not supported) }
  611.     xltFIELD                            { Field level translation (Logical types) }
  612.   );
  613.  
  614.   UPDLockMode = (                       { Update lock mode (SQL only) }
  615.     updWHEREALL,                        { All fields in WHERE clause }
  616.     updWHEREKEYCHG,                     { Keyed and changed fields in WHERE clause }
  617.     updWHEREKEY                         { Keyed fields in WHERE clause }
  618.   );
  619.  
  620.   TEXACTRECCNTExpensive = (             { Whether DbiGetExactRecordCount is expensive }
  621.     exactRecCntINEXPENSIVE,             { inexpensive }
  622.     exactRecCntEXPENSIVE,               { expensive }
  623.     exactRecCntUNKNOWN                  { record count is unknown }
  624.   );
  625.  
  626.   pServerColDesc = ^ServerColDesc;
  627.   ServerColDesc = packed record         { Auto increment and Defaults property }
  628.    iFldNum     : Word;                  { Field id }
  629.    bServerCol  : WordBool;              { Auto Increment and Default }
  630.   end;
  631.  
  632.  
  633.  
  634. { Table levels }
  635.  
  636. const
  637.   TBLLEVEL3          = 3;               { Paradox level 3 and dBASE level 3+ }
  638.   TBLLEVEL4          = 4;               { Paradox level 4 and dBASE level 4 }
  639.   TBLLEVEL5          = 5;               { Paradox level 5 and dBASE/Win }
  640.   TBLLEVEL7          = 7;               { Paradox level 7 , Win32, dBASE/Win 7 }
  641.   FOXLEVEL25         = 25;              { Fox Table (Ver 2.5) }
  642.  
  643. type
  644.   pCURProps = ^CURProps;
  645.   CURProps = packed record              { Virtual Table properties }
  646.     szName          : DBITBLNAME;       { table name (no extension, if it can be derived) }
  647.     iFNameSize      : Word;             { Full file name size }
  648.     szTableType     : DBINAME;          { Driver type }
  649.     iFields         : Word;             { No of fields in Table }
  650.     iRecSize        : Word;             { Record size (logical record) }
  651.     iRecBufSize     : Word;             { Record size (physical record) }
  652.     iKeySize        : Word;             { Key size }
  653.     iIndexes        : Word;             { Number of indexes }
  654.     iValChecks      : Word;             { Number of val checks }
  655.     iRefIntChecks   : Word;             { Number of Ref Integrity constraints }
  656.     iBookMarkSize   : Word;             { Bookmark size }
  657.     bBookMarkStable : WordBool;         { Stable book marks }
  658.     eOpenMode       : DBIOpenMode;      { ReadOnly / RW }
  659.     eShareMode      : DBIShareMode;     { Excl / Share }
  660.     bIndexed        : WordBool;         { Index is in use }
  661.     iSeqNums        : SmallInt;         { 1: Has Seqnums; 0: Has Record# }
  662.     bSoftDeletes    : WordBool;         { Supports soft deletes }
  663.     bDeletedOn      : WordBool;         { If above, deleted recs seen }
  664.     iRefRange       : Word;             { Not used }
  665.     exltMode        : XLTMode;          { Translate Mode }
  666.     iRestrVersion   : Word;             { Restructure version number }
  667.     bUniDirectional : WordBool;         { Cursor is uni-directional }
  668.     eprvRights      : Word;             { Table  rights }
  669.     Dummy4          : Word;
  670.     iFmlRights      : Word;             { Family rights }
  671.     iPasswords      : Word;             { Number of Aux passwords }
  672.     iCodePage       : Word;             { Codepage (0 if unknown) }
  673.     bProtected      : WordBool;         { Table is protected by password }
  674.     iTblLevel       : Word;             { Driver dependent table level }
  675.     szLangDriver    : DBINAME;          { Language driver name }
  676.     bFieldMap       : WordBool;         { Field map active }
  677.     iBlockSize      : Word;             { Physical file blocksize in K }
  678.     bStrictRefInt   : WordBool;         { Strict referential integrity }
  679.     iFilters        : Word;             { Number of filters }
  680.     bTempTable      : WordBool;         { Table is a temporary table }
  681.     iUnUsed         : packed array [0..15] of Word;
  682.   end;
  683.  
  684. { Delayed Update Types and Constants }
  685.  
  686. type
  687.   DBIDelayedUpdCmd = (                  { Op types for Delayed Update cursor }
  688.     dbiDelayedUpdCommit,                { Commit the updates }
  689.     dbiDelayedUpdCancel,                { Rollback the updates }
  690.     dbiDelayedUpdCancelCurrent,         { Cancel the Current Rec Change }
  691.     dbiDelayedUpdPrepare                { Phase1 of 2 phase commit }
  692.   );
  693.  
  694. const
  695.   DBIDELAYUPD_SHOWMODIFYBIT    = $1;    { Show only modified records. }
  696.   DBIDELAYUPD_SHOWINSERTBIT    = $2;    { Show only inserted records. }
  697.   DBIDELAYUPD_SHOWDELETEBIT    = $4;    { Show only deleted records. }
  698.   DBIDELAYUPD_SHOWNONMODIFYBIT = $8;    { Show only unmodified recs. }
  699.  
  700. {============================================================================}
  701. {                   Record Properties                                        }
  702. {============================================================================}
  703.  
  704. type
  705.   pRECProps = ^RECProps;
  706.   RECProps = packed record              { Record properties }
  707.     iSeqNum         : Longint;          { When Seq# supported only }
  708.     iPhyRecNum      : Longint;          { When Phy Rec#s supported only }
  709.     iRecStatus      : Word;             { Delayed Updates Record Status }
  710.     bSeqNumChanged  : WordBool;         { Not used }
  711.     bDeleteFlag     : WordBool;         { When soft delete supported only }
  712.   end;
  713.  
  714.  
  715. {============================================================================}
  716. {                   General properties  DbiGetProp/DbiSetProp                }
  717. {============================================================================}
  718.  
  719.  
  720. { Cursor properties }
  721. { General           }
  722.  
  723. const
  724.   curMAXPROPS        = $00050000;       { ro UINT16   , Number of defined properties }
  725.   curTABLENAME       = $00050001;       { ro pTBLNAME , Table name }
  726.   curTABLETYPE       = $00050002;       { ro pDBINAME , Table type }
  727.   curTABLELEVEL      = $00050003;       { ro UINT16   , Table level 1..n }
  728.   curFILENAME        = $00050004;       { ro pPATH    , Full filename }
  729.   curXLTMODE         = $00050005;       { rw XLTMode  , Translate mode }
  730.   curSEQREADON       = $00050006;       { rw BOOL     , Sequential read mode hint ON }
  731.   curONEPASSON       = $00050007;       { rw BOOL     , One pass mode hint ON }
  732.   curUPDATETS        = $00050008;       { ro TIMESTAMP, Update timestamp }
  733.   curSOFTDELETEON    = $00050009;       { rw BOOL     , Softdelete ON }
  734.   curLANGDRVNAME     = $0005000A;       { ro pCHAR    , Symbolic language drv. name }
  735.   curCURSORNAME      = $0005000B;       { ro pCHAR    , name of the cursor }
  736.   curPESSIMISTICLOCKS= $0005000C;       { rw BOOL     , Pess Locks = TRUE, Optimistic = FALSE }
  737.   curEXACTRECCNTEXPENSIVE= $0005000D;   { ro EXPENSIVE, Whether DbiGetRecordCount is expensive }
  738.   curCOMPRESSARRAYFLDDESC= $0005000E;   { rw BOOL, Compress ARRAY field desc }
  739.   curMAXFIELDID      = $0005000F;       { ro UINT16, Max # of field desc }
  740.   curFIELDFULLNAME   = $00050010;       { ro pObjAttrDesc, Object attribute name }
  741.   curFIELDTYPENAME   = $00050011;       { ro pObjTypeDesc, Object Type name }
  742.   curFIELDIDFORNAME  = $00050012;       { ro Field id returned for a given fieldname }
  743.   curFIELDIDFORPARENT= $00050013;       { ro Field id of the parent returned }
  744.   curMAKECRACK       = $00050014;       { Create a crack at the current cursor position }
  745.   curFIELDISAUTOINCR = $00050015;       { wo BOOL, Auto increment field }
  746.   curFIELDISDEFAULT  = $00050016;       { wo BOOL, Default field }
  747.   curAUTOREFETCH     = $00050017;       { rw BOOL, Refetch inserted record }
  748.  
  749.   maxcurPROPS        = 23;              { keep in sync when adding cursor properties }
  750.  
  751. { Paradox specific }
  752.   curPDXMAXPROPS     = $01050000;       { ro UINT16   , Number of defined properties }
  753.   maxcurPDXPROPS     = 0;
  754.  
  755. { DBase specific }
  756.   curDBMAXPROPS      = $02050000;       { ro UINT16   , Number of defined properties }
  757.   curINEXACTON       = $02050001;       { rw BOOL     , InExact match ON }
  758.   curSHAREMODE       = $02050002;       { rw DBIShareMode, Share mode }
  759.   maxcurDBPROPS      = 2;
  760.  
  761. { Text Driver specific }
  762.   curDELIMITALLFLDS  = $03050000;       { rw BOOL , Delimit all fields. }
  763.   curUSESCHEMAFILE   = $03050001;       { rw BOOL , read schema from a file }
  764.  
  765. { SQL Driver specific }
  766.   curUPDLOCKMODE     = $04050000;       { rw UPDLockMode, Update lock mode }
  767.   curNATIVEHNDL      = $04050001;       { ro pBYTE, Native cursor handle }
  768.   curMAXROWS         = $04050002;       { rw INT32, Max rows to fetch from server }
  769.   curGETEXTENDEDINFO = $04050003;       { rw BOOL, Get RINT info etc. }
  770.   curGETHIDDENCOLUMNS= $04050004;       { rw BOOL , Get all selected columns from server. }
  771.   curAUTOFLUSHREF    = $04050005;       { rw BOOL, automatic flush ref }
  772.   curREFINSERTTABLENAME= $04050006;     { rw pTBLNAME , REF Table name }
  773.   curGETREF          = $04050007;       { ro REF of inserted record }
  774.   curCONSTSTATE      = $0405009B;       { rw BOOL, enable/disable constraints }
  775.  
  776. { Delayed Updates Specific. }
  777.   curDELAYUPDRECSTATE     = $05050001;  { ro DELYUPDCbDesc }
  778.   curDELAYUPDABORTRESTORE = $05050002;  { rw BOOL, restore state }
  779.                                         {  when commit is aborted. }
  780.   curDELAYUPDDISPLAYOPT   = $05050003;  { rw UINT16, view records }
  781.                                         {  with specific update status }
  782.   curDELAYUPDGETOLDRECORD = $05050004;  { rw BOOL, get un-modified }
  783.                                         {  rec buf for modified recs }
  784.   curDELAYUPDNUMUPDATES   = $05050005;  { ro INT32, num of updates }
  785.   curDELAYUPDUSECALLBACK  = $05050006;  { rw BOOL, callback usr. }
  786.  
  787. { Driver properties }
  788. { General           }
  789.   drvMAXPROPS        = $00030000;       { ro UINT16   , Number of defined properties }
  790.   drvDRIVERTYPE      = $00030002;       { ro pDBINAME , Driver type }
  791.   drvDRIVERVERSION   = $00030003;       { ro UINT16   , Driver version }
  792.   maxdrvPROPS        = 2;               { keep in sync when adding driver properties }
  793.  
  794.   drvPSEUDOINDEX     = $ff030001;       { ro BOOL, Pseudo Index Support. }
  795.   
  796. { SQL Driver specific }
  797.   drvNATIVESQLCA     = $00030004;       { ro pBYTE    , Native SQLCA structure (Informix) }
  798.  
  799. { Database properties }
  800. { General             }
  801.   dbMAXPROPS         = $00040000;       { ro UINT16   , Number of defined properties }
  802.   dbDATABASENAME     = $00040001;       { ro pDBINAME , Database name/alias }
  803.   dbDATABASETYPE     = $00040002;       { ro pDBINAME , Database type }
  804.   dbDEFAULTDRIVER    = $00040003;       { rw pDBINAME , Default Driver name }
  805.   dbPARAMFMTQMARK    = $00040004;       { rw BOOL     , Stmt param marker fmt = ? }
  806.   dbUSESCHEMAFILE    = $00040005;       { rw BOOL , for text driver only. }
  807.   maxdbPROPS         = 27;              { keep in sync when adding ANY db properties }
  808.  
  809. { SQL Driver specific }
  810.   dbASYNCSUPPORT     = $04040000;       { ro BOOL     , Async. qry exec support }
  811.   dbPROCEDURES       = $04040001;       { ro BOOL     , Stored procedure support }
  812.   dbDEFAULTTXNISO    = $04040002;       { ro eXILType , Default transaction iso level }
  813.   dbNATIVEHNDL       = $04040003;       { ro pBYTE    , Native connection handle }
  814.   dbNATIVEPASSTHRUHNDL = $04040004;     { ro pBYTE    , Native passthru connection handle }
  815.   dbSERVERVERSION    = $04040005;       { ro UINT16   , Major server version number }
  816.   dbBATCHCOUNT       = $04040006;       { rw UINT16   , Batch modification count before auto-commit }
  817.   dbTRACEMODE        = $04040007;       { rw UINT16   , Trace mode }
  818.   dbCURRENTUSERNAME  = $04040008;       { rw UINT16   , Current User Name }
  819.   dbOWNERQUALIFIED   = $04040009;       { ro BOOL     , For SQL Link Drivers - does this driver support }
  820.   dbQUOTECHAR        = $0404000A;       { ro CHAR     , Quote character for quoting Object Names }
  821.   dbONLINE           = $0404000B;       { ro BOOL     , Informix ONLINE }
  822.   dbTRANALLOWED      = $0404000C;       { ro BOOL     , Informix Transactions allowed. }
  823.   dbANSI             = $0404000D;       { ro BOOL     , Informix Ansi complaint database. }
  824.   dbDBMSNAME         = $0404000E;       { ro pDBINAME , DB2 specific Database (OS/2 or MVS or AS/400). }
  825.   dbBLOBCOUNT        = $0404000F;       { ro UINT16, No.of dead BLOB to cache. }
  826.   dbBLOBSIZE         = $04040010;       { ro UINT16, Dead BLOB fetch buffer size. }
  827.   dbCOMPRESSARRAYFLDDESC  = $04040011;  { rw BOOL, VARRAY in compressed format, ORACLE 8 specific. }
  828.   dbWAITONLOCK       = $04040012;      { rw BOOL, Lock resolution on transactions , Interbase specific. }
  829.   dbCOMMITRETAIN     = $04040013;      { rw BOOL, Commit mode for explicit transactions , Interbase specific. }
  830.  
  831.   dbSCHEMACACHEENABLED = $04040099;     { w BOOL     , TRUE - enabled/FALSE - disabled }
  832.   dbBCDENABLED       = $0404009A;       { rw BOOL , enable BCD field types. }
  833.  
  834. { Session properties }
  835. { General            }
  836.   sesMAXPROPS        = $00020000;       { ro UINT16   , Number of defined properties }
  837.   sesSESSIONNAME     = $00020001;       { ro pDBINAME , Name of seesion }
  838.   sesNETFILE         = $00020002;       { rw pCHAR    , Full filename of netfile (MAXPATHLEN) }
  839.   sesCFGMODE         = $00020003;       { rw CFGMode, Mode of configuration file. }
  840.   sesDEFAULTDRIVER   = $00020004;       { rw pDBINAME, default driver name }
  841.   sesGROUPNAME       = $00020005;       { rw pCHAR, Security - user group name (dBASE) }
  842.   sesUSERNAME        = $00020006;       { rw pCHAR, User Name }
  843.   sesUSERPASSWORD    = $00020007;       { rw pCHAR, User password }
  844.   sesSECFILENAME     = $00020008;       { rw pCHAR, Location of dBASE Security file }
  845.   sesDRNAME          = $00020009;       { rw pCHAR, Repository Database Name }
  846.   sesCFGUPDATE       = $0002000A;       { rw CFGUpdate, Mode for updating session configuration }
  847.   sesCFGNAME         = $0002000B;       { ro CFGName, get session configuration name }
  848.   sesCFGMODE2        = $0002000C;       { rw new CFGMode (persist, session, virtual) }
  849.   sesCFGRefresh      = $0002000F;       { rw, set session to refresh virtual config }
  850.   maxsesPROPS        = 13;              { keep in sync when adding session properties }
  851.  
  852. { System properties }
  853. { General           }
  854.   sysMAXPROPS        = $00010000;       { ro UINT16  , Number of defined properties }
  855.   sysLOWMEMUSAGE     = $00010001;       { ro UINT16  , Low memory usage in (k) }
  856.   maxsysPROPS        = 1;               { keep in sync when adding system properties }
  857.  
  858. { Statement properties }
  859. { General              }
  860.   stmtMAXPROPS       = $00060001;       { ro UINT16      Number of defined properties }
  861.   stmtPARAMETERCOUNT = $00060002;       { ro UINT16      Count of parameters }
  862.   stmtPARAMETERDESCS = $00060003;       { ro aFLDDesc    Array of parameters }
  863.   stmtLANGDRVNAME    = $00060004;       { ro pCHAR       Symbolic language drv. name }
  864.   stmtUNIDIRECTIONAL = $00060010;       { rw BOOL        Cursor Unidirectional }
  865.   stmtCURSORNAME     = $00060011;       { rw pCHAR       Cursor name }
  866.   stmtNEWCONNECT     = $00060012;       { rw BOOL        Stmt on new connection }
  867.   stmtNATIVEHNDL     = $00060013;       { ro pBYTE       Native statement handle }
  868.   stmtROWCOUNT       = $00060014;       { ro UINT32      Rows effected by a stmt }
  869.   stmtEXECASCURSOR   = $00060015;       { rw BOOL        Open a server cursor (ct-lib) }
  870.   maxstmtPROPS       = 32;              { keep in sync when adding ANY stmt properties }
  871.  
  872. { specific to QBE or local SQL }
  873.   stmtANSTYPE        = $00060020;       { rw pBYTE       Table Type of Answer set }
  874.   stmtLIVENESS       = $00060021;       { rw LIVENESS    Preference for canned/live answers }
  875.   stmtQRYMODE        = $00060022;       { rw QryEvalMode Execute on server or local or either }
  876.   stmtBLANKS         = $00060023;       { rw BOOL        True if blanks to be regarded as zeros. }
  877.   stmtDATEFORMAT     = $00060024;       { rw FMTDate     Date format }
  878.   stmtNUMBERFORMAT   = $00060025;       { rw FMTNumber   Number format }
  879.   stmtAUXTBLS        = $00060026;       { rw BOOL        True if QBE to create CHANGED, etc. }
  880.   stmtTBLVECTOR      = $00060027;       { ro UINT16      Vector of tables generated by query. }
  881.   stmtALLPROPS       = $00060028;       { rw QueryLowProps }
  882.   stmtALLPROPSSIZE   = $00060029;       { rw INT16       size of QueryLowProps }
  883.   stmtANSNAME        = $00060030;       { rw pBYTE       Answer Table Name. }
  884.   stmtCONSTRAINED    = $00060031;       { rw BOOL        Constrain input }
  885.   stmtFIELDDESCS     = $00060032;       { rw pFLDDESC    Answer FieldDescs }
  886.   stmtCURPROPS       = $00060033;       { rw pCURProps    Answer Curprops }
  887.   stmtDEFDBNAME      = $00060034;       { rw pCURProps    Answer Curprops }
  888.   stmtXLTMODE        = $00060035;       { rw XLTMode      Xltmode }
  889.   stmtINSTBLNAME     = $00060036;       { ro DBITBLNAME  INSERT table's name }
  890.   stmtINSERRTBLNAME  = $00060037;       { ro DBITBLNAME  ERRINS table's name }
  891.   stmtUPDTBLNAME     = $00060038;       { ro DBITBLNAME  UPDATE table's name }
  892.   stmtUPDERRTBLNAME  = $00060039;       { ro DBITBLNAME  ERRUPD table's name }
  893.   stmtDELTBLNAME     = $00060040;       { ro DBITBLNAME  DELETED table's name }
  894.   stmtDELERRTBLNAME  = $00060041;       { ro DBITBLNAME  ERRDEL table's name }
  895.   stmtCANNEDREADONLY = $00060042;       { rw BOOL canned answers are readonly }
  896.  
  897.  
  898. {============================================================================}
  899. {                    Transactions                                            }
  900. {============================================================================}
  901.  
  902. { Transaction support }
  903.  
  904. type
  905.   eXILType = (                          { Transaction isolation levels }
  906.     xilDIRTYREAD,                       { Uncommitted changes read }
  907.     xilREADCOMMITTED,                   { Committed changes, no phantoms }
  908.     xilREPEATABLEREAD                   { Full read repeatability }
  909.   );
  910.  
  911.   eXEnd = (                             { Transaction end control }
  912.     xendCOMMIT,                         { Commit transaction }
  913.     xendCOMMITKEEP,                     { Commit transaction, keep cursors }
  914.     xendABORT                           { Rollback transaction }
  915.   );
  916.  
  917.   eXState = (                           { Transaction end control }
  918.     xsINACTIVE,                         { Transaction inactive }
  919.     xsACTIVE                            { Transaction active }
  920.   );
  921.  
  922. type
  923.   pXInfo = ^XInfo;
  924.   XInfo = packed record
  925.     exState         : eXState;          { xsActive, xsInactive }
  926.     eXIL            : eXILType;         { Xact isolation level }
  927.     uNests          : Word;             { Xact children }
  928.   end;
  929.  
  930.  
  931. {============================================================================}
  932. {                         BookMark compares                                  }
  933. {============================================================================}
  934.  
  935. type
  936.   PCMPBkMkRslt = ^CMPBkMkRslt;
  937.   CMPBkMkRslt = TypedEnum;
  938. const
  939.     CMPLess           = -1;             { Bkm1 < Bkm2 }
  940.     CMPEql            = 0;              { BookMarks are exactly the same }
  941.     CMPGtr            = 1;              { Bkm1 > Bkm2 }
  942.     CMPKeyEql         = 2;              { Only Bkm1.key_val = Bkm2.key_val }
  943.  
  944. {============================================================================}
  945. {                             Key searches                                   }
  946. {============================================================================}
  947.  
  948. type
  949.   DBISearchCond = (                     { Search condition for keys }
  950.     keySEARCHEQ,                        { = }
  951.     keySEARCHGT,                        { > }
  952.     keySEARCHGEQ                        { >= }
  953.   );
  954.  
  955. {============================================================================}
  956. {                      Create/Restructure descriptor                         }
  957. {============================================================================}
  958.  
  959. type
  960.   pCROpType          = ^CROpType;
  961.   CROpType = (                          { Create/Restruct Operation type }
  962.     crNOOP,
  963.     crADD,                              { Add a new element. }
  964.     crCOPY,                             { Copy an existing element. }
  965.     crMODIFY,                           { Modify an element. }
  966.     crDROP,                             { Removes an element. }
  967.     crREDO,                             { Reconstruct an element. }
  968.     crTABLE,                            { Not used }
  969.     crGROUP,                            { Not used }
  970.     crFAMILY,                           { Not used }
  971.     crDONE,                             { Used internally }
  972.     crDROPADD                           { Used internally }
  973.   );
  974.  
  975. type
  976.   pCRTblDesc         = ^CRTblDesc;
  977.   CRTblDesc = packed record             { Create/Restruct Table descr }
  978.     szTblName       : DBITBLNAME;       { TableName incl. optional path & ext }
  979.     szTblType       : DBINAME;          { Driver type (optional) }
  980.     szErrTblName    : DBIPATH;          { Error Table name (optional) }
  981.     szUserName      : DBINAME;          { User name (if applicable) }
  982.     szPassword      : DBINAME;          { Password (optional) }
  983.     bProtected      : WordBool;         { Master password supplied in szPassword }
  984.     bPack           : WordBool;         { Pack table (restructure only) }
  985.     iFldCount       : Word;             { Number of field defs supplied }
  986.     pecrFldOp       : pCROpType;        { Array of field ops }
  987.     pfldDesc        : pFLDDesc;         { Array of field descriptors }
  988.     iIdxCount       : Word;             { Number of index defs supplied }
  989.     pecrIdxOp       : pCROpType;        { Array of index ops }
  990.     pidxDesc        : PIDXDesc;         { Array of index descriptors }
  991.     iSecRecCount    : Word;             { Number of security defs supplied }
  992.     pecrSecOp       : pCROpType;        { Array of security ops }
  993.     psecDesc        : pSECDesc;         { Array of security descriptors }
  994.     iValChkCount    : Word;             { Number of val checks }
  995.     pecrValChkOp    : pCROpType;        { Array of val check ops }
  996.     pvchkDesc       : pVCHKDesc;        { Array of val check descs }
  997.     iRintCount      : Word;             { Number of ref int specs }
  998.     pecrRintOp      : pCROpType;        { Array of ref int ops }
  999.     printDesc       : pRINTDesc;        { Array of ref int specs }
  1000.     iOptParams      : Word;             { Number of optional parameters }
  1001.     pfldOptParams   : pFLDDesc;         { Array of field descriptors }
  1002.     pOptData        : Pointer;          { Optional parameters }
  1003.   end;
  1004.  
  1005. {============================================================================}
  1006. {                      Batch                                                 }
  1007. {============================================================================}
  1008.  
  1009. type
  1010.   pBATTblDesc        = ^BATTblDesc;
  1011.   BATTblDesc = packed record            { Batch Table definition struct }
  1012.     hDb             : hDBIDb;           { Database }
  1013.     szTblName       : DBIPATH;          { Table name }
  1014.     szTblType       : DBINAME;          { Optional Driver type }
  1015.     szUserName      : DBINAME;          { Optional User name }
  1016.     szPassword      : DBINAME;          { Optional Pass word }
  1017.   end;
  1018.  
  1019.   eBATMode = (                          { Batch mode for DBIBatchMove }
  1020.     batchAPPEND,
  1021.     batchUPDATE,
  1022.     batchAPPENDUPDATE,
  1023.     batchSUBTRACT,
  1024.     batchCOPY
  1025.   );
  1026.  
  1027. type
  1028.   pSORTOrder         = ^SORTOrder;
  1029.   SORTOrder = (                         { Sort Order }
  1030.     sortASCEND,                         { ascending (default) }
  1031.     sortDESCEND                         { descending }
  1032.   );
  1033.  
  1034.   ppfSORTCompFn = ^pfSORTCompFn;
  1035.   pfSORTCompFn = function (             { pntr to client compare fn }
  1036. var   LdObj         : Pointer;          { Language driver, if needed }
  1037. var   Value1        : Pointer;          { first value }
  1038. var   Value2        : Pointer;          { second value }
  1039.       iLen          : SmallInt              { Length, if needed }
  1040.    ): SmallInt;
  1041.  
  1042.       { Returns: -1 if (Value 1 < Value 2),  }
  1043.       {           0 if (Value 1 == Value 2), }
  1044.       {          +1 if (Value 1 > Value 2)   }
  1045.  
  1046. {============================================================================}
  1047. {                       Types/Structs for Capabilities                       }
  1048. {============================================================================}
  1049.  
  1050. type
  1051.   DRVCat = (                            { Driver Category }
  1052.     drvFILLER,                          { Filler to make next start at 1 }
  1053.     drvFILE,                            { File based (Paradox, xBASE) }
  1054.     drvOTHERSERVER,                     { Other kind of server (IMS ?) }
  1055.     drvSQLBASEDSERVER,                  { SQL Based Server }
  1056.     drvOLEDBPROVIDER                    { OLE DB Provider }
  1057.   );
  1058.  
  1059.   OPType = (                            { Config info & Optional Parameters }
  1060.     opFILLER0,                          { Filler to make first one 3 }
  1061.     opFILLER1,                          { Filler to make first one 3 }
  1062.     opFILLER2,                          { Filler to make first one 3 }
  1063.     opDBCREATE,
  1064.     opDBOPEN,
  1065.     opTBLCREATE,
  1066.     opTBLOPEN
  1067.   );
  1068.  
  1069. type
  1070.   pDRVType = ^DRVType;
  1071.   DRVType = packed record               { Driver Description/Capabilities }
  1072.     szType          : DBINAME;          { Symbolic name to identify }
  1073.     szText          : DBINAME;          { Descriptive text }
  1074.     edrvCat         : DRVCat;           { Driver category }
  1075.     bTrueDb         : WordBool;         { Supports True Db concept }
  1076.     szDbType        : DBINAME;          { Db Type to be used }
  1077.     bMultiUser      : WordBool;         { Supports Multi-user access }
  1078.     bReadWrite      : WordBool;         { Read Write or Read-only }
  1079.     bTrans          : WordBool;         { Supports Transactions }
  1080.     bPassThruSQL    : WordBool;         { Supports Pass-thru SQL }
  1081.     bLogIn          : WordBool;         { Requires explicit login }
  1082.     bCreateDb       : WordBool;         { Can reate a Database }
  1083.     bDeleteDb       : WordBool;         { Can drop database }
  1084.     bCreateTable    : WordBool;         { Can create a Table }
  1085.     bDeleteTable    : WordBool;         { Can delete a Table }
  1086.     bMultiplePWs    : WordBool;         { Multiple passwords }
  1087.     iDriverVersion  : Word;             { Driver version 1..n }
  1088.     bSQLRowid       : WordBool;         { Supports SQL rowid }
  1089.     iUnUsed         : packed array [0..14] of Word;
  1090.   end;
  1091.  
  1092.  
  1093.   pTBLType = ^TBLType;
  1094.   TBLType = packed record               { Table Capabilities }
  1095.     iId             : Word;             { Id of Table Type }
  1096.     szName          : DBINAME;          { Symbolic name; eg "dBASE" }
  1097.     szText          : DBINAME;          { Descriptive text }
  1098.     szFormat        : DBINAME;          { Format; eg "HEAP" }
  1099.     bReadWrite      : WordBool;         { User can Read/Write }
  1100.     bCreate         : WordBool;         { Can create new tables }
  1101.     bRestructure    : WordBool;         { Can restructure this table }
  1102.     bValChecks      : WordBool;         { Val Checks can be specified }
  1103.     bSecurity       : WordBool;         { Can be protected }
  1104.     bRefIntegrity   : WordBool;         { Can participate in ref integrity }
  1105.     bPrimaryKey     : WordBool;         { Supports primary key concept }
  1106.     bIndexing       : WordBool;         { Can have other indexes }
  1107.     iFldTypes       : Word;             { Number of Phy Field types supported }
  1108.     iMaxRecSize     : Word;             { Max record size }
  1109.     iMaxFldsInTable : Word;             { Max fields in a table }
  1110.     iMaxFldNameLen  : Word;             { Maximum field name length }
  1111.     iTblLevel       : Word;             { Driver dependent table level (version) }
  1112.     iUnUsed         : packed array [0..15] of Word;
  1113.   end;
  1114.  
  1115.  
  1116.   pIDXType = ^IDXType;
  1117.   IDXType = packed record
  1118.     iId             : Word;             { Id of Index Type }
  1119.     szName          : DBINAME;          { Symbolic name }
  1120.     szText          : DBINAME;          { Descriptive text }
  1121.     szFormat        : DBINAME;          { Optional format(BTREE, HASH etc) }
  1122.     bComposite      : WordBool;         { Supports composite keys }
  1123.     bPrimary        : WordBool;         { True, if primary index }
  1124.     bUnique         : WordBool;         { True, No duplicates supported }
  1125.     bKeyDescending  : WordBool;         { If whole key can be descending }
  1126.     bFldDescending  : WordBool;         { Field level descending }
  1127.     bMaintained     : WordBool;         { Supports maintained option }
  1128.     bSubset         : WordBool;         { Supports Subset expression }
  1129.     bKeyExpr        : WordBool;         { If Key can be expres }
  1130.     bCaseInsensitive : WordBool;        { Supports Caseinsensitive indexes }
  1131.     iUnUsed         : packed array [0..15] of Word;
  1132.   end;
  1133.  
  1134.   pFLDType = ^FLDType;
  1135.   FLDType = packed record
  1136.     iId             : Word;             { Id of Field Type }
  1137.     szName          : DBINAME;          { Symbolic name; eg "ALPHA" }
  1138.     szText          : DBINAME;          { Descriptive text }
  1139.     iPhyType        : Word;             { Physical/Native type }
  1140.     iXltType        : Word;             { Default xlated type }
  1141.     iXltSubType     : Word;             { Default xlated sub type }
  1142.     iMaxUnits1      : Word;             { Max units allowed (1) }
  1143.     iMaxUnits2      : Word;             { Max units allowed (2) }
  1144.     iPhySize        : Word;             { Physical size in bytes (per unit) }
  1145.     bRequired       : WordBool;         { Supports 'required' option }
  1146.     bDefaultVal     : WordBool;         { Supports user specified 'default' }
  1147.     bMinVal         : WordBool;         { Supports MIN Val constraint }
  1148.     bMaxVal         : WordBool;         { Supports MAX Val constraint }
  1149.     bRefIntegrity   : WordBool;         { Can participate in ref integrity }
  1150.     bOtherChecks    : WordBool;         { Supports other kinds of checks }
  1151.     bKeyed          : WordBool;         { The field type can be keyed }
  1152.     bMultiplePerTable : WordBool;       { Table can have more than 1 of this type }
  1153.     iMinUnits1      : Word;             { Min units required (1) }
  1154.     iMinUnits2      : Word;             { Min units required (2) }
  1155.     bCreateable     : WordBool;         { Type can be created }
  1156.     szNativeName    : DBINAME;          { Native (SQL) name used in DDL }
  1157.     iUnUsed         : packed array [0..15] of Word;
  1158.   end;
  1159.  
  1160.   PROPValid = (                         { PROP Validity }
  1161.     epropINVALID,                       { Property is INVALID (not supported) }
  1162.     epropCANGET,                        { You can GET value of the property }
  1163.     epropCANSET                         { You can GET and SET value of the property }
  1164.   );
  1165.  
  1166. {============================================================================}
  1167. {                                Call Backs                                  }
  1168. {============================================================================}
  1169.  
  1170. type
  1171.   pCBType            = ^CBType;
  1172.   CBType = (                            { Call back type }
  1173.     cbGENERAL,                          { General purpose }
  1174.     cbRESERVED1,
  1175.     cbRESERVED2,
  1176.     cbINPUTREQ,                         { Input requested }
  1177.     cbRESERVED4,
  1178.     cbRESERVED5,
  1179.     cbBATCHRESULT,                      { Batch processing rslts }
  1180.     cbRESERVED7,
  1181.     cbRESTRUCTURE,                      { Restructure }
  1182.     cbRESERVED9,
  1183.     cbRESERVED10,
  1184.     cbRESERVED11,
  1185.     cbRESERVED12,
  1186.     cbRESERVED13,
  1187.     cbRESERVED14,
  1188.     cbRESERVED15,
  1189.     cbRESERVED16,
  1190.     cbRESERVED17,
  1191.     cbTABLECHANGED,                     { Table changed notification }
  1192.     cbRESERVED19,
  1193.     cbCANCELQRY,                        { Allow user to cancel Query }
  1194.     cbSERVERCALL,                       { Server Call }
  1195.     cbRESERVED22,
  1196.     cbGENPROGRESS,                      { Generic Progress report. }
  1197.     cbDBASELOGIN,                       { dBASE Login }
  1198.     cbDELAYEDUPD,                       { Delayed Updates }
  1199.     cbFIELDRECALC,                      { Field(s) recalculation }
  1200.     cbTRACE,                            { Trace }
  1201.     cbDBLOGIN,                          { Database login }
  1202.     cbDETACHNOTIFY,                     { DLL Detach Notification }
  1203.     cbNBROFCBS                          { Number of cbs }
  1204.   );
  1205.  
  1206. const
  1207.   cbYIELDCLIENT = cbCANCELQRY;
  1208.  
  1209. type
  1210.   pCBRType           = ^CBRType;
  1211.   CBRType = (                           { Call-back return type }
  1212.     cbrUSEDEF,                          { Take default action }
  1213.     cbrCONTINUE,                        { Continue }
  1214.     cbrABORT,                           { Abort the operation }
  1215.     cbrCHKINPUT,                        { Input given }
  1216.     cbrYES,                             { Take requested action }
  1217.     cbrNO,                              { Do not take requested action }
  1218.     cbrPARTIALASSIST,                   { Assist in completing the job }
  1219.     cbrSKIP,                            { Skip this operation }
  1220.     cbrRETRY                            { Retry this operation }
  1221.   );
  1222.  
  1223.   ppfDBICallBack = ^pfDBICallBack;
  1224.   pfDBICallBack  = function (           { Call-back funtion pntr type }
  1225.       ecbType       : CBType;           { Callback type }
  1226.       iClientData   : Longint;          { Client callback data }
  1227.       CbInfo        : Pointer           { Call back info/Client Input }
  1228.    ): CBRType stdcall;
  1229.  
  1230. { Progress callback structure }
  1231.  
  1232.   pCBPROGRESSDesc = ^CBPROGRESSDesc;
  1233.   CBPROGRESSDesc  = packed record
  1234.     iPercentDone    : SmallInt;         { Percentage done. }
  1235.     szMsg           : DBIMSG;           { Message to display }
  1236.   end;
  1237.  
  1238.   DelayUpdErrOpType = (                 { type of delayed update object (delayed updates callback) }
  1239.     delayupdNONE,
  1240.     delayupdMODIFY,
  1241.     delayupdINSERT,
  1242.     delayupdDELETE
  1243.   );
  1244.  
  1245.   PDELAYUPDCbDesc = ^DELAYUPDCbDesc;
  1246.   DELAYUPDCbDesc = packed record        { delayed updates callback info }
  1247.     iErrCode        : DBIResult;
  1248.     eDelayUpdOpType : DelayUpdErrOpType;
  1249.     iRecBufSize     : Word;             { Record size (physical record) }
  1250.     pNewRecBuf      : Pointer;
  1251.     pOldRecBuf      : Pointer;
  1252.   end;
  1253.  
  1254.   RESTErrObjType = (                    { type of restructure object (restructure callback) }
  1255.     restrNONE,
  1256.     restrNEWFLD,
  1257.     restrOLDFLD,
  1258.     restrNEWINDEX,
  1259.     restrOLDINDEX,
  1260.     restrNEWVCHK,
  1261.     restrOLDVCHK,
  1262.     restrNEWRINT,
  1263.     restrOLDRINT,
  1264.     restrNEWSEC,
  1265.     restrOLDSEC,
  1266.     restrNEWTABLE
  1267.   );
  1268.  
  1269.   pCBDBLogin = ^TCBDBLogin;
  1270.   TCBDBLogin = packed record            { Database login }
  1271.     szDbName        : DBINAME;          { Database name }
  1272.     eOpenMode       : DBIOpenMode;      { Open type desired }
  1273.     eShareMode      : DBIShareMode;     { Share type desired }
  1274.     szPassword      : DBINAME;          { Password }
  1275.     bCallbackToClose : Bool;            { Returned flag }
  1276.     hDb             : hDBIDb;           { db handle }
  1277.   end;
  1278.  
  1279. type
  1280.   pTRACECat = ^TRACECat;                { trace categories }
  1281.   TRACECat = TypedEnum;
  1282. const
  1283.     traceUNKNOWN   = $0000;
  1284.     traceQPREPARE  = $0001;             { prepared query statements }
  1285.     traceQEXECUTE  = $0002;             { executed query statements }
  1286.     traceERROR     = $0004;             { vendor errors }
  1287.     traceSTMT      = $0008;             { statement ops (i.e. allocate, free) }
  1288.     traceCONNECT   = $0010;             { connect / disconnect }
  1289.     traceTRANSACT  = $0020;             { transaction }
  1290.     traceBLOB      = $0040;             { blob i/o }
  1291.     traceMISC      = $0080;             { misc. }
  1292.     traceVENDOR    = $0100;             { vendor calls }
  1293.     traceDATAIN    = $0200;             { parameter bound data }
  1294.     traceDATAOUT   = $0400;             { trace fetched data }
  1295.  
  1296. type
  1297.   pTRACEDesc = ^TRACEDesc;
  1298.   TRACEDesc = packed record             { trace callback info }
  1299.     eTraceCat       : TRACECat;
  1300.     uTotalMsgLen    : Word;
  1301.     pszTrace        : array [0..0] of Char;
  1302.   end;
  1303.  
  1304. type
  1305.   TuObjDesc = packed record
  1306.     case Integer of
  1307.       1: (fldDesc:  FLDDesc);
  1308.       2: (idxDesc:  IDXDesc);
  1309.       3: (vchkDesc: VCHKDesc);
  1310.       4: (rintDesc: RINTDesc);
  1311.       5: (secDesc:  SECDesc);
  1312.   end;
  1313.  
  1314.   RESTCbDesc = packed record            { restructure callback info }
  1315.     iErrCode        : DBIResult;
  1316.     iTblNum         : Word;
  1317.     iObjNum         : Word;
  1318.     eRestrObjType   : RESTErrObjType;
  1319.     uObjDesc        : TuObjDesc;
  1320.   end;
  1321.  
  1322.   CBEntry = packed record
  1323.     szKeyWord       : DBINAME;          { Keyword to display }
  1324.     szHelp          : DBIMSG;           { Help String }
  1325.   end;
  1326.  
  1327. const
  1328.   MAXCBENTRIES       = 4;
  1329.  
  1330. type
  1331.   CBInputId = (
  1332.     cbiFILLER,                          { Force next to start at 1 }
  1333.     cbiMDXMISSING,                      { MDX file missing request }
  1334.     cbiPDXLOOKUP,                       { Lookup table missing }
  1335.     cbiPDXBLOB,                         { Blob file missing }
  1336.     cbiDBTMISSING,                      { DBT file missing request }
  1337.     cbiDRINPUT,                         { DR Manager needs user input }
  1338.     cbiRINTMISSING                      { RefInt link missing/corrupt }
  1339.   );
  1340.  
  1341.   PCBInputDesc = ^CBInputDesc;
  1342.   CBInputDesc = packed record
  1343.     eCbInputId      : CBInputId;        { Id for this input request }
  1344.     iCount          : SmallInt;         { Number of entries }
  1345.     iSelection      : SmallInt;         { Selection 1..n  (In/Out) }
  1346.     bSave           : WordBool;         { Save this option  (In/Out) }
  1347.     szMsg           : DBIMSG;           { Message to display }
  1348.     acbEntry        : packed array [0..MAXCBENTRIES-1] of CBEntry; { Entries }
  1349.   end;
  1350.  
  1351.   pCBLoginDesc = ^CBLoginDesc;
  1352.   CBLoginDesc  = packed record          { dBASE login callback structure }
  1353.     szUserName      : DBINAME;          { Login name of user }
  1354.     szGroupName     : DBINAME;          { Group to log in to }
  1355.     szUserPassword  : DBINAME;          { User password }
  1356.   end;
  1357.  
  1358. { cbSERVERCALL info }
  1359.  
  1360.   PCBSCType = ^CBSCType;
  1361.   CBSCType = (                             { Server call type }
  1362.     cbscRETURN,                            { Return from a call }
  1363.     cbscSQL                                { SQL server call }
  1364.   );
  1365.  
  1366. { cbYIELDCLIENT }
  1367.  
  1368.   PCBYieldStep = ^CBYieldStep;
  1369.   CBYieldStep = (
  1370.     cbYieldFirst,
  1371.     cbYieldContinue,
  1372.     cbYieldLast
  1373.   );
  1374.  
  1375. {============================================================================}
  1376. {                         Basic Query Types                                  }
  1377. {============================================================================}
  1378.  
  1379. type
  1380.   DBIQryLang = (
  1381.     qrylangUNKNOWN,                     { UNKNOWN (Error) }
  1382.     qrylangQBE,                         { QBE }
  1383.     qrylangSQL                          { SQL }
  1384.   );
  1385.  
  1386. {============================================================================}
  1387. {                         Statement parameter information                    }
  1388. {============================================================================}
  1389.  
  1390. type
  1391.   eINDValues = TypedEnum;
  1392. const
  1393.     indTRUNC     = -2;                   { Value has been truncated }
  1394.     indNULL      = -1;                   { Value is NULL }
  1395.     indVALUE     = 1;
  1396.  
  1397. const
  1398.   INDLEN             = sizeof(Word);
  1399.  
  1400. type
  1401.   STMTParamType = (
  1402.     paramUNKNOWN,                       { UNKNOWN (Error) }
  1403.     paramIN,                            { Input parameter }
  1404.     paramOUT,                           { Output parameter }
  1405.     paramINOUT,                         { Input/Output parameter }
  1406.     paramRET                            { Procedure (or function) return }
  1407.   );
  1408.  
  1409.   STMTParamFormat = (
  1410.     paramfmtUNKNOWN,                    { UNKNOWN (Error) }
  1411.     paramfmtNUMBER,                     { Numbered parameter markers of the form ? or :n }
  1412.     paramfmtNAME                        { Named parameters markers of the form :name }
  1413.   );
  1414.  
  1415. {============================================================================}
  1416. {                         Properties For DbiQPrepareExt                      }
  1417. {============================================================================}
  1418.  
  1419. const
  1420.   qprepNONE          = 0;               { like DbiQPrepare }
  1421.   qprepFORUPDATE     = $1;              { do extra work, anticipating UPDATE WHERE CURRENT }
  1422.  
  1423.  
  1424. {============================================================================}
  1425. {                      Date, Time, Number Formats                            }
  1426. {============================================================================}
  1427.  
  1428. type
  1429.   pFMTNumber = ^FMTNumber;
  1430.   FMTNumber = packed record             { Date Format }
  1431.     cDecimalSeparator : Char;           { Default "." }
  1432.     cThousandSeparator : Char;          { Default "," }
  1433.     iDecimalDigits  : Byte;             { Default 2 }
  1434.     bLeadingZero    : Boolean;          { Default TRUE. }
  1435.   end;
  1436.  
  1437.   pFMTDate = ^FMTDate;
  1438.   FMTDate = packed record
  1439.     szDateSeparator : packed array [0..3] of Char;    { Default "/" }
  1440.     iDateMode       : Byte;            { 0 = MDY (Def), 1 = DMY, 2 = YMD }
  1441.     bFourDigitYear  : Boolean;         { Write Year as 4 digits (FALSE) }
  1442.     bYearBiased     : Boolean;         { On input add 1900 to year (TRUE) }
  1443.     bMonthLeadingZero : Boolean;       { Month with Leading Zero (TRUE) }
  1444.     bDayLeadingZero : Boolean;         { Day with Leading Zero (TRUE) }
  1445.   end;
  1446.  
  1447.   pFMTTime = ^FMTTime;
  1448.   FMTTime = packed record
  1449.     cTimeSeparator  : Char;             { Default ":" }
  1450.     bTwelveHour     : Boolean;          { Represent as 12 Hour time (FALSE) }
  1451.     szAmString      : packed array [0..5] of Char;    { Default Null (Only for 12 Hr) }
  1452.     szPmString      : packed array [0..5] of Char;    { Default Null (Only for 12 Hr) }
  1453.     bSeconds        : Boolean;          { Show Seconds (TRUE) }
  1454.     bMilSeconds     : Boolean;          { Show Milli Seconds (FALSE) }
  1455.   end;
  1456.  
  1457.   pFMTBcd = ^FMTBcd;
  1458.   FMTBcd  = packed record
  1459.     iPrecision      : Byte;             { 1..64 considered valid }
  1460.     iSignSpecialPlaces : Byte;          { sign:1, special:1, places:6 }
  1461.     iFraction       : packed array [0..31] of Byte;    { bcd nibbles, 00..99 per byte, high nibble 1st }
  1462.   end;
  1463.  
  1464.  
  1465. {============================================================================}
  1466. {                              Error Info                                    }
  1467. {============================================================================}
  1468.  
  1469. type
  1470.   pDBIErrInfo        = ^DBIErrInfo;
  1471.   DBIErrInfo = packed record            { Error info }
  1472.     iError          : DBIResult;        { Last error code returned }
  1473.     szErrCode       : DBIMSG;           { Error Code }
  1474.     szContext       : packed array[1..4] of DBIMSG;    { Context info }
  1475.   end;
  1476.  
  1477. { Error contexts (To be used with DbiGetErrorContext) }
  1478.  
  1479. const
  1480.   ecTOKEN            = 1;               { Token (For QBE) }
  1481.   ecTABLENAME        = 3;               { Table name }
  1482.   ecFIELDNAME        = 4;               { Field Name }
  1483.   ecIMAGEROW         = 5;               { Image Row (For QBE) }
  1484.   ecUSERNAME         = 6;               { eg, In lock conflicts, user involved }
  1485.   ecFILENAME         = 7;               { File Name }
  1486.   ecINDEXNAME        = 8;               { Index Name }
  1487.   ecDIRNAME          = 9;               { Directory Name }
  1488.   ecKEYNAME          = 10;              { Key Name }
  1489.   ecALIAS            = 11;              { Alias }
  1490.   ecDRIVENAME        = 12;              { Drive name ('c:') }
  1491.   ecNATIVECODE       = 13;              { Native error code }
  1492.   ecNATIVEMSG        = 14;              { Native error message }
  1493.   ecLINENUMBER       = 15;              { Line Number }
  1494.   ecCAPABILITY       = 16;              { Capability }
  1495.   ecCDRNAME          = 17;              { Client Data Repository Name }
  1496.   ecUSERERRMSG       = 18;              { User Defined error msg }
  1497.   ecDROBJNAME        = 19;              { Data Repository Object Name }
  1498.   ecINTERNALLIMIT    = 20;              { Internal limit }
  1499.   ecEXPRESSION       = 21;              { SQL Expression }
  1500.  
  1501. {============================================================================}
  1502. {                  Schema info structures                                    }
  1503. {============================================================================}
  1504. {                    Database descriptor                                     }
  1505. {============================================================================}
  1506.  
  1507.  
  1508. { DbiOpenDatabaseList }
  1509. type
  1510.   pDBDesc = ^DBDesc;
  1511.   DBDesc = packed record                { A given Database Description }
  1512.     szName          : DBINAME;          { Logical name (Or alias) }
  1513.     szText          : DBINAME;          { Descriptive text }
  1514.     szPhyName       : DBIPATH;          { Physical name/path }
  1515.     szDbType        : DBINAME;          { Database type }
  1516.   end;
  1517.  
  1518.  
  1519. {============================================================================}
  1520. {                    User info descriptor                                    }
  1521. {============================================================================}
  1522.  
  1523.  
  1524. { DbiOpenUserList }
  1525. type
  1526.   pUSERDesc = ^USERDesc;
  1527.   USERDesc = packed record              { User description }
  1528.     szUserName      : DBIUSERNAME;
  1529.     iNetSession     : Word;             { Net level session number }
  1530.     iProductClass   : Word;             { Product class of user }
  1531.     szSerialNum     : packed array [0..21] of Char; { Serial number }
  1532.   end;
  1533.  
  1534. {============================================================================}
  1535. {                    Table descriptor                                        }
  1536. {============================================================================}
  1537.  
  1538.  
  1539. { DbiOpenTableList }
  1540. type
  1541.   pTBLBaseDesc = ^TBLBaseDesc;
  1542.   TBLBaseDesc = packed record           { Table description (Base) }
  1543.     szName          : DBITBLNAME;       { Table name(No extension or Dir) }
  1544.     szFileName      : DBITBLNAME;       { File name }
  1545.     szExt           : DBIEXT;           { File extension }
  1546.     szType          : DBINAME;          { Driver type }
  1547.     dtDate          : DBIDATE;          { Date on the table }
  1548.     tmTime          : Time;             { Time on the table }
  1549.     iSize           : Longint;          { Size in bytes }
  1550.     bView           : WordBool;         { If this a view }
  1551.     bSynonym        : WordBool;         { If this is a synonym }
  1552.   end;
  1553.  
  1554.   pTBLExtDesc = ^TBLExtDesc;
  1555.   TBLExtDesc = packed record            { Table description (Extended part) }
  1556.     szStruct        : DBINAME;          { Physical structure }
  1557.     iRestrVersion   : Word;             { Version # }
  1558.     iRecSize        : Word;             { Physical record size }
  1559.     iFields         : Word;             { Number of fields }
  1560.     iIndexes        : Word;             { Number Indexes }
  1561.     iValChecks      : Word;             { Number of field validity checks }
  1562.     iRintChecks     : Word;             { Number of ref. integrity checks }
  1563.     iRecords        : Longint;          { Number of records in table }
  1564.     bProtected      : WordBool;         { If the table is prot }
  1565.     bValidInfo      : WordBool;         { Info available for this table }
  1566.   end;
  1567.  
  1568.   pTBLFullDesc = ^TBLFullDesc;
  1569.   TBLFullDesc = packed record           { Table description (Base + Ext) }
  1570.     tblBase         : TBLBaseDesc;      { Base      description }
  1571.     tblExt          : TBLExtDesc;       { Extended  description }
  1572.   end;
  1573.  
  1574. {============================================================================}
  1575. {                    File descriptor                                         }
  1576. {============================================================================}
  1577.  
  1578.  
  1579. { DbiOpenFileList }
  1580. type
  1581.   pFILEDesc = ^FILEDesc;
  1582.   FILEDesc = packed record              { File description }
  1583.     szFileName      : DBIPATH;          { File name (No Dir or ext) }
  1584.     szExt           : DBIEXT;           { Extension }
  1585.     bDir            : WordBool;         { True, if directory }
  1586.     iSize           : Longint;          { File size in bytes }
  1587.     dtDate          : DBIDATE;          { Date on the file }
  1588.     tmTime          : Time;             { Time on the file }
  1589.   end;
  1590.  
  1591. {======================================================================}
  1592. {            Stored Procedure and Stored Procedure Param descriptor    }
  1593. {======================================================================}
  1594.  
  1595. type
  1596.   pSPDesc = ^SPDesc;
  1597.   SPDesc = packed record
  1598.     szName          : DBISPNAME;
  1599.     dtDate          : DBIDATE;
  1600.     tmTime          : Time;
  1601.   end;
  1602.  
  1603.   pSPParamDesc = ^SPParamDesc;
  1604.   SPParamDesc = packed record
  1605.     uParamNum       : Word;
  1606.     szName          : DBINAME;
  1607.     eParamType      : STMTParamType;
  1608.     uFldType        : Word;
  1609.     uSubType        : Word;
  1610.     iUnits1         : SmallInt;
  1611.     iUnits2         : SmallInt;
  1612.     uOffset         : Word;
  1613.     uLen            : Word;
  1614.     uNullOffset     : Word;
  1615.   end;
  1616.  
  1617. {======================================================================}
  1618. {            Function and Function Argument Descriptors                }
  1619. {======================================================================}
  1620.  
  1621. type
  1622.   DBISTDFuncs = (
  1623.     fnAVG,
  1624.     fnCOUNT,
  1625.     fnMIN,
  1626.     fnMAX,
  1627.     fnSUM,
  1628.     fnSTDDEV,
  1629.     fnVARIANCE,
  1630.     fnABS,
  1631.     fnCEIL,
  1632.     fnCOS,
  1633.     fnCOSH,
  1634.     fnEXP,
  1635.     fnFLOOR,
  1636.     fnLN,
  1637.     fnLOG,
  1638.     fnMOD,
  1639.     fnPOWER,
  1640.     fnROUND,
  1641.     fnSIGN,
  1642.     fnSIN,
  1643.     fnSINH,
  1644.     fnSQRT,
  1645.     fnTAN,
  1646.     fnTANH,
  1647.     fnTRUNC,
  1648.     fnCHR,
  1649.     fnCONCAT,
  1650.     fnINITCAP,
  1651.     fnLOWER,
  1652.     fnLPAD,
  1653.     fnLTRIM,
  1654.     fnNLS_INITCAP,
  1655.     fnNLS_LOWER,
  1656.     fnNLS_UPPER,
  1657.     fnREPLACE,
  1658.     fnRPAD,
  1659.     fnRTRIM,
  1660.     fnSOUNDEX,
  1661.     fnSUBSTR,
  1662.     fnSUBSTRB,
  1663.     fnTRANSLATE,
  1664.     fnUPPER,
  1665.     fnASCII,
  1666.     fnINSTR,
  1667.     fnINSTRB,
  1668.     fnLENGTH,
  1669.     fnLENGTHB,
  1670.     fnNLSSORT,
  1671.     fnADD_MONTHS,
  1672.     fnLAST_DAY,
  1673.     fnMONTHS_BETWEEN,
  1674.     fnNEW_TIME,
  1675.     fnNEXT_DAY,
  1676.     fnSYSDATE,
  1677.     fnCONVERT,
  1678.     fnTO_CHAR,
  1679.     fnTO_DATE,
  1680.     fnTO_MULTI_BYTE,
  1681.     fnTO_NUMBER,
  1682.     fnTO_SINGLE_BYTE,
  1683.     fnUID,
  1684.     fnUSER,
  1685.     fnORACLEMISC,
  1686.     fnACOS,
  1687.     fnASIN,
  1688.     fnATAN,
  1689.     fnATN2,
  1690.     fnCOT,
  1691.     fnDEGREES,
  1692.     fnLOG10,
  1693.     fnPI,
  1694.     fnRADIANS,
  1695.     fnRAND,
  1696.     fnTEXTPTR,
  1697.     fnTEXTVALID,
  1698.     fnCHARINDEX,
  1699.     fnDIFFERENCE,
  1700.     fnPATINDEX,
  1701.     fnREPLICATE,
  1702.     fnREVERSE,
  1703.     fnRIGHT,
  1704.     fnSPACE,
  1705.     fnSTR,
  1706.     fnSTUFF,
  1707.     fnCOL_NAME,
  1708.     fnCOL_LENGTH,
  1709.     fnDATALENGTH,
  1710.     fnDB_ID,
  1711.     fnDB_NAME,
  1712.     fnHOST_ID,
  1713.     fnHOST_NAME,
  1714.     fnINDEX_COL,
  1715.     fnOBJECT_ID,
  1716.     fnOBJECT_NAME,
  1717.     fnUSER_ID,
  1718.     fnUSER_NAME,
  1719.     fnLEFT,
  1720.     fnLOCATE,
  1721.     fnTRUNCATE,
  1722.     fnCURTIME,
  1723.     fnDAYNAME,
  1724.     fnDAYOFMONTH,
  1725.     fnDAYOFWEEK,
  1726.     fnDAYOFYEAR,
  1727.     fnHOUR,
  1728.     fnMINUTE,
  1729.     fnMONTH,
  1730.     fnMONTHNAME,
  1731.     fnNOW,
  1732.     fnQUARTER,
  1733.     fnSECOND,
  1734.     fnWEEK,
  1735.     fnYEAR,
  1736.     fnDAY,
  1737.     fnWEEKDAY,
  1738.     fnTODAY,
  1739.     fnDATE,
  1740.     fnINFMISC
  1741.   );
  1742.  
  1743. type
  1744.   DBIFuncFlags = TypedEnum;
  1745.  
  1746. const
  1747.   fnSCALARS_ALLOW_CONSTANTS           = $0001;    { fn args may contain refeences to constants | }
  1748.   fnSCALARS_ALLOW_COLUMNS             = $0002;    { fn args may contain refeences to columns }
  1749.   fnSCALARS_ALLOW_PARAMETERS          = $0004;    { fn args may contain refeences to parameters }
  1750.   fnSCALARS_ALLOW_FUNCTIONS           = $0008;    { fn args may contain refeences to functions }
  1751.   fnSCALARS_ALLOW_USER_DEFINED_FUNCS  = $0010;    { fn args may contain refeences to user defined functions }
  1752.   fnSCALARS_ALLOW_SUBQUERIES          = $0020;    { fn args can contain subqueries }
  1753.   fnSCALARS_ALLOW_CORRELATION         = $0040;    { fn subqueries can be correlated }
  1754.  
  1755. type
  1756.   DBIFUNCOpts = (
  1757.     fnDummy,
  1758.     fnListINCL_USER_DEF                 { include user-defined functions }
  1759.   );
  1760.  
  1761.   pDBIFUNCDesc = ^DBIFUNCDesc;
  1762.   DBIFUNCDesc  = packed record
  1763.     szName          : DBINAME;          { Function name }
  1764.     szDesc          : packed array [0..254] of Char; { Short description }
  1765.     uOverload       : Word;             { Number of function overloads }
  1766.     eStdFn          : DBISTDFuncs;      { Corresponds to DBI standard function }
  1767.   end;
  1768.  
  1769.  
  1770.   pDBIFUNCArgDesc = ^DBIFUNCArgDesc;
  1771.   DBIFUNCArgDesc  = packed record
  1772.     uArgNum         : Word;             { Argument position num; 0 for fn return }
  1773.     uFldType        : Word;             { Field type }
  1774.     uSubType        : Word;             { Field subtype (if applicable) }
  1775.     ufuncFlags      : Word;             { Function flags }
  1776.   end;
  1777.  
  1778. {============================================================================}
  1779. {                   Configuration Info Descriptor                            }
  1780. {============================================================================}
  1781.  
  1782.   CFGMode = (
  1783.     cfgPersistent,                      { Persistent only }
  1784.     cfgSession,                         { Session relative only }
  1785.     cfgAll                              { All (system and single session) }
  1786.   );
  1787.  
  1788. type
  1789.   CFGMode2 = type Integer;
  1790. const
  1791.     cfgmNone        = $00;
  1792.     cfgmVirtual     = $01;
  1793.     cfgmPersistent  = $02;
  1794.     cfgmSession     = $04;
  1795.     cfgmAll         = cfgmVirtual or cfgmPersistent or cfgmSession;
  1796.  
  1797. type
  1798.   CFGUpdate = (
  1799.     cfgUpdateOn,                        { Accept updates from other sessions }
  1800.     cfgUpdateOff                        { Do not updates from other sessions }
  1801.   );
  1802.  
  1803. { DbiOpenCfgInfoList }
  1804. type
  1805.   pCFGDesc = ^CFGDesc;
  1806.   CFGDesc = packed record               { Config description }
  1807.     szNodeName      : DBINAME;          { Node name }
  1808.     szDescription   : packed array [0..DBIMAXSCFLDLEN-1] of Char; { Node description }
  1809.     iDataType       : Word;             { Value type }
  1810.     szValue         : packed array [0..DBIMAXSCFLDLEN-1] of Char; { Value }
  1811.     bHasSubnodes    : WordBool;         { True, if not leaf node }
  1812.   end;
  1813.  
  1814.  
  1815. {============================================================================}
  1816. {                    Family descriptor                                       }
  1817. {============================================================================}
  1818.  
  1819.  
  1820. type
  1821.   pFMLType = ^FMLType;
  1822.   FMLType  = (                          { Family member types }
  1823.     fmlUNKNOWN,
  1824.     fmlTABLE,
  1825.     fmlINDEX,
  1826.     fmlFORM,
  1827.     fmlREPORT,
  1828.     fmlVALCHECK,
  1829.     fmlSECINDEX,
  1830.     fmlSECINDEX2,
  1831.     fmlBLOBFILE
  1832.   );
  1833.  
  1834. { DbiOpenFamilyList }
  1835. type
  1836.   pFMLDesc = ^FMLDesc;
  1837.   FMLDesc = packed record               { Family record structure }
  1838.     szName          : DBINAME;          { Member name (documentary) }
  1839.     iId             : Word;             { Id (if applicable) }
  1840.     eType           : FMLType;          { Member type }
  1841.     szFileName      : DBIPATH;          { File name of member }
  1842.   end;
  1843.  
  1844.  
  1845. {============================================================================}
  1846. {                    Language driver descriptor                              }
  1847. {============================================================================}
  1848.  
  1849.  
  1850. const
  1851.   DBIOEM_CP          = 1;               { (dos) }
  1852.   DBIANSI_CP         = 2;               { (win) }
  1853.   DBIOS2_CP          = 3;               { (OS2) }
  1854. (* UNIX etc. *)
  1855.   DBISUNOS_CP        = 4;
  1856.   DBIVMS_CP          = 5;
  1857.   DBIHPUX_CP         = 6;
  1858.   DBIULTRIX_CP       = 7;
  1859.   DBIAIX_CP          = 8;
  1860.   DBIAUX_CP          = 9;
  1861.   DBIXENIX_CP        = 10;
  1862.   DBIMAC_CP          = 11;
  1863.   DBINEXT_CP         = 12;
  1864.   DBIUNICODE_CP      = 13;
  1865.   DBIROMEN8_CP       = 14;
  1866.   DBIISO_CP          = 15;
  1867.  
  1868. { DbiOpenLdList }
  1869. type
  1870.   pLDDesc = ^LDDesc;
  1871.   LDDesc = packed record                { Lang Driver description }
  1872.     szName          : DBINAME;          { Driver symbolic name }
  1873.     szDesc          : DBINAME;          { Description }
  1874.     iCodePage       : Word;
  1875.     PrimaryCpPlatform : Word;
  1876.     AlternateCpPlatform : Word;
  1877.   end;
  1878.  
  1879. {============================================================================}
  1880. {                    Lock descriptor                                         }
  1881. {============================================================================}
  1882.  
  1883. { Lock types in LOCKDesc: }
  1884.  
  1885. const
  1886.   lckRECLOCK         = 0;               { Normal Record lock (Write) }
  1887.   lckRRECLOCK        = 1;               { Special Pdox Record lock (Read) }
  1888.   lckGROUPLOCK       = 2;               { Pdox Group lock }
  1889.   lckIMGAREA         = 3;               { Pdox Image area }
  1890.   lckTABLEREG        = 4;               { Table registration/Open (No lock) }
  1891.   lckTABLEREAD       = 5;               { Table Read lock }
  1892.   lckTABLEWRITE      = 6;               { Table Write lock }
  1893.   lckTABLEEXCL       = 7;               { Table Exclusive lock }
  1894.   lckUNKNOWN         = 9;               { Unknown lock }
  1895.  
  1896. { DbiOpenLockList }
  1897. type
  1898.   pLOCKDesc = ^LOCKDesc;
  1899.   LOCKDesc = packed record              { Lock Description }
  1900.     iType           : Word;             { Lock type (0 for rec lock) }
  1901.     szUserName      : DBIUSERNAME;      { Lock owner }
  1902.     iNetSession     : Word;             { Net level Session number }
  1903.     iSession        : Word;             { Idapi session#, if our lock }
  1904.     iRecNum         : Longint;          { If a record lock }
  1905.     iInfo           : Word;             { Info for table locks }
  1906.   end;
  1907.  
  1908. {============================================================================}
  1909. {                    Filter description                                      }
  1910. {============================================================================}
  1911.  
  1912. type
  1913.   pCANOp = ^CANOp;
  1914.   CANOp  = (
  1915.     canNOTDEFINED,                      {                                  (*) }
  1916.     canISBLANK,                         { CANUnary;  is operand blank.     (*) }
  1917.     canNOTBLANK,                        { CANUnary;  is operand not blank. (*) }
  1918.     canEQ,                              { CANBinary, CANCompare; equal.    (*) }
  1919.     canNE,                              { CANBinary; NOT equal.            (*) }
  1920.     canGT,                              { CANBinary; greater than.         (*) }
  1921.     canLT,                              { CANBinary; less than.            (*) }
  1922.     canGE,                              { CANBinary; greater or equal.     (*) }
  1923.     canLE,                              { CANBinary; less or equal.        (*) }
  1924.     canNOT,                             { CANUnary; NOT                    (*) }
  1925.     canAND,                             { CANBinary; AND                   (*) }
  1926.     canOR,                              { CANBinary; OR                    (*) }
  1927.     canTUPLE2,                          { CANUnary; Entire record is operand. }
  1928.     canFIELD2,                          { CANUnary; operand is field       (*) }
  1929.     canCONST2,                          { CANUnary; operand is constant    (*) }
  1930.     canMINUS,                           { CANUnary;  minus. }
  1931.     canADD,                             { CANBinary; addition. }
  1932.     canSUB,                             { CANBinary; subtraction. }
  1933.     canMUL,                             { CANBinary; multiplication. }
  1934.     canDIV,                             { CANBinary; division. }
  1935.     canMOD,                             { CANBinary; modulo division. }
  1936.     canREM,                             { CANBinary; remainder of division. }
  1937.     canSUM,                             { CANBinary, accumulate sum of. }
  1938.     canCOUNT,                           { CANBinary, accumulate count of. }
  1939.     canMIN,                             { CANBinary, find minimum of. }
  1940.     canMAX,                             { CANBinary, find maximum of. }
  1941.     canAVG,                             { CANBinary, find average of. }
  1942.     canCONT,                            { CANBinary; provides a link between two }
  1943.     canUDF2,                            { CANBinary; invokes a User defined fn }
  1944.     canCONTINUE2,                       { CANUnary; Stops evaluating records }
  1945.     canLIKE,                            { CANCompare, extended binary compare       (*) }
  1946.     canIN,                              { CANBinary field in list of values }
  1947.     canLIST2,                           { List of constant values of same type }
  1948.     canUPPER,                           { CANUnary: upper case }
  1949.     canLOWER,                           { CANUnary: lower case }
  1950.     canFUNC2,                           { CANFunc: Function }
  1951.     canLISTELEM2,                       { CANListElem: List Element }
  1952.     canASSIGN                           { CANBinary: Field assignment }
  1953.   );
  1954.  
  1955.   NODEClass = (                         { Node Class }
  1956.     nodeNULL,                           { Null node                  (*) }
  1957.     nodeUNARY,                          { Node is a unary            (*) }
  1958.     nodeBINARY,                         { Node is a binary           (*) }
  1959.     nodeCOMPARE,                        { Node is a compare          (*) }
  1960.     nodeFIELD,                          { Node is a field            (*) }
  1961.     nodeCONST,                          { Node is a constant         (*) }
  1962.     nodeTUPLE,                          { Node is a record }
  1963.     nodeCONTINUE,                       { Node is a continue node    (*) }
  1964.     nodeUDF,                            { Node is a UDF node }
  1965.     nodeLIST,                           { Node is a LIST node }
  1966.     nodeFUNC,                           { Node is a Function node }
  1967.     nodeLISTELEM                        { Node is a List Element node }
  1968.   );
  1969.  
  1970. { NODE definitions including misc data structures }
  1971. {-------------------------------------------------}
  1972.  
  1973. type
  1974.   pCANHdr = ^CANHdr;
  1975.   CANHdr = packed record                { Header part common to all     (*) }
  1976.     nodeClass       : NODEClass;
  1977.     canOp           : CANOp;
  1978.   end;
  1979.  
  1980.   pCANUnary = ^CANUnary;
  1981.   CANUnary = packed record              { Unary Node                    (*) }
  1982.     nodeClass       : NODEClass;
  1983.     canOp           : CANOp;
  1984.     iOperand1       : Word;             { Byte offset of Operand node }
  1985.   end;
  1986.  
  1987.   pCANBinary = ^CANBinary;
  1988.   CANBinary = packed record             { Binary Node                   (*) }
  1989.     nodeClass       : NODEClass;
  1990.     canOp           : CANOp;
  1991.     iOperand1       : Word;             { Byte offset of Op1 }
  1992.     iOperand2       : Word;             { Byte offset of Op2 }
  1993.   end;
  1994.  
  1995.   pCANField = ^CANField;
  1996.   CANField = packed record              { Field }
  1997.     nodeClass       : NODEClass;
  1998.     canOp           : CANOp;
  1999.     iFieldNum       : Word;
  2000.     iNameOffset     : Word;             { Name offset in Literal pool }
  2001.   end;
  2002.  
  2003.   pCANConst = ^CANConst;
  2004.   CANConst = packed record              { Constant }
  2005.     nodeClass       : NODEClass;
  2006.     canOp           : CANOp;
  2007.     iType           : Word;             { Constant type. }
  2008.     iSize           : Word;             { Constant size. (in bytes) }
  2009.     iOffset         : Word;             { Offset in the literal pool. }
  2010.   end;
  2011.  
  2012.   pCANTuple = ^CANTuple;
  2013.   CANTuple = packed record              { Tuple (record) }
  2014.     nodeClass       : NODEClass;
  2015.     canOp           : CANOp;
  2016.     iSize           : Word;             { Record size. (in bytes) }
  2017.   end;
  2018.  
  2019.   pCANContinue = ^CANContinue;
  2020.   CANContinue = packed record           { Break Node                    (*) }
  2021.     nodeClass       : NODEClass;
  2022.     canOp           : CANOp;
  2023.     iContOperand    : Word;             { Continue if operand is true. }
  2024.   end;
  2025.  
  2026.   pCANCompare = ^CANCompare;
  2027.   CANCompare = packed record            { Extended compare Node (text fields) (*) }
  2028.     nodeClass       : NODEClass;
  2029.     canOp           : CANOp;            { canLIKE, canEQ }
  2030.     bCaseInsensitive : WordBool;        { 3 val: UNKNOWN = "fastest", "native" }
  2031.     iPartialLen     : Word;             { Partial fieldlength (0 is full length) }
  2032.     iOperand1       : Word;             { Byte offset of Op1 }
  2033.     iOperand2       : Word;             { Byte offset of Op2 }
  2034.   end;
  2035.  
  2036.   pCANFunc = ^CANFunc;
  2037.   CANFunc = packed record               { Function }
  2038.     nodeClass       : NODEClass;
  2039.     canOp           : CANOp;
  2040.     iNameOffset     : Word;             { Name offset in Literal pool }
  2041.     iElemOffset     : Word;             { Offset of first List Element in Node pool }
  2042.   end;
  2043.  
  2044.   pCANListElem = ^CANListElem;
  2045.   CANListElem = packed record           { List Element }
  2046.     nodeClass       : NODEClass;
  2047.     canOp           : CANOp;
  2048.     iOffset         : Word;             { Arg offset in Node pool }
  2049.     iNextOffset     : Word;             { Offset in Node pool of next ListElem or 0 if end of list }
  2050.   end;
  2051.  
  2052. {This is the node to be used to pass User defined functions }
  2053. const
  2054.   iLangSQL           = 0;               { Common SQL dialect }
  2055.   iDbaseExpr         = 2;               { This is also the driver ID for dBASE }
  2056.  
  2057. type
  2058.   pCANUdf = ^CANUdf;
  2059.   CANUdf = packed record                { A user defined function }
  2060.     nodeClass       : NODEClass;
  2061.     canOp           : CANOp;
  2062.     iOffSzFuncName  : Word;             { Offset in literal pool to Function Name string(0 terminated) }
  2063.     iOperands       : Word;             { Byte offset of Operands (concatenated using canCONT) }
  2064.     iDrvDialect     : Word;             { Driver Dialect ID for UDF string supplied }
  2065.     iOffSzUDF       : Word;             { Offset in literal pool to UDF string (0 terminated) }
  2066.   end;
  2067.  
  2068.   pCANList = ^CANList;
  2069.   CANList = packed record           { List of Constants }
  2070.     nodeClass       : NODEClass; 
  2071.     canOp           : CANOp;
  2072.     iType           : Word;            { Constant type. }
  2073.     iTotalSize      : Word;            { Total list size; }
  2074.     iElemSize       : Word;            { Size of each elem for fix-width types }
  2075.     iElems          : Word;            { Number of elements in list }
  2076.     iOffset         : Word;            { Offset in the literal pool to first elem. }
  2077.   end;
  2078.  
  2079.   pCANNode = ^CANNode;
  2080.   CANNode = packed record
  2081.     case Integer of
  2082.       0: (canHdr      : CANHdr);
  2083.       1: (canUnary    : CANUnary);
  2084.       2: (canBinary   : CANBinary);
  2085.       3: (canField    : CANField);
  2086.       4: (canConst    : CANConst);
  2087.       5: (canTuple    : CANTuple);
  2088.       6: (canContinue : CANContinue);
  2089.       7: (canCompare  : CANCompare);
  2090.       8: (canList     : CANList);
  2091.       9: (canFunc     : CANFunc);
  2092.      10: (canListElem : CANListElem);
  2093.   end;
  2094.  
  2095. { Linear exression tree}
  2096. {----------------------}
  2097.  
  2098. const
  2099.   CANEXPRVERSION     = 2;
  2100.  
  2101. type
  2102.   ppCANExpr = ^pCANExpr;
  2103.   pCANExpr  = ^CANExpr;
  2104.   CANExpr   = packed record             { Expression Tree }
  2105.     iVer            : Word;             { Version tag of expression. }
  2106.     iTotalSize      : Word;             { Size of this structure }
  2107.     iNodes          : Word;             { Number of nodes }
  2108.     iNodeStart      : Word;             { Starting offet of Nodes in this }
  2109.     iLiteralStart   : Word;             { Starting offset of Literals in this }
  2110.   end;
  2111.  
  2112. {pfGENFilter returns TRUE, FALSE or ABORT }
  2113. const
  2114.   ABORT              = -2;
  2115.  
  2116. type
  2117.   pfGENFilter = function (
  2118.       ulClientData  : Longint;
  2119.       pRecBuf       : Pointer;
  2120.       iPhyRecNum    : Longint
  2121.    ): SmallInt stdcall;
  2122.  
  2123.   pFILTERInfo = ^FILTERInfo;
  2124.   FILTERInfo = packed record
  2125.     iFilterId       : Word;             { Id for filter }
  2126.     hFilter         : hDBIFilter;       { Filter handle }
  2127.     iClientData     : Longint;          { Client supplied data }
  2128.     iPriority       : Word;             { 1..N with 1 being highest }
  2129.     bCanAbort       : WordBool;         { TRUE : pfFilter can return ABORT }
  2130.     pfFilter        : pfGENFilter;      { Client filter function }
  2131.     pCanExpr        : Pointer;          { Supplied expression }
  2132.     bActive         : WordBool;         { TRUE : filter is active }
  2133.   end;
  2134.  
  2135. {----------------------------------------------------------------------------}
  2136. {   DBI Query related types                                                  }
  2137. {----------------------------------------------------------------------------}
  2138.  
  2139. const
  2140.   MAXQBEEXPRSIZE     = 300;             { size of one QBE expr }
  2141.  
  2142. type
  2143.   pDBIQryProp = ^DBIQryProp;
  2144.   DBIQryProp = packed record
  2145.     szQryName       : DBINAME;          { Name of query }
  2146.     eLang           : DBIQryLang;       { Language }
  2147.     iQryPrice       : SmallInt;         { Query price 1..100 (1 = cheap, 100 = expensive) }
  2148.     iNumTables      : SmallInt;         { Number of tables in join.  0 = unknown. }
  2149.     bHasAnswer      : WordBool;
  2150.     bInsert         : WordBool;
  2151.     bDelete         : WordBool;
  2152.     bChange         : WordBool;
  2153.   end;
  2154.  
  2155. const
  2156.   DBIQBE_ANSWERBIT   = ($1);            { Answer table bit flag }
  2157.   DBIQBE_INSERTEDBIT = ($2);            { Inserted table bit flag }
  2158.   DBIQBE_DELETEDBIT  = ($4);            { Deleted table bit flag }
  2159.   DBIQBE_CHANGEDBIT  = ($8);            { Changed table bit flag }
  2160.   DBIQBE_ERRORINSBIT = ($10);           { Error inserted table bit flag }
  2161.   DBIQBE_ERRORDELBIT = ($20);           { Error deleted table bit flag }
  2162.   DBIQBE_ERRORCHGBIT = ($40);           { Error changed table bit flag }
  2163.  
  2164.  
  2165. { answer cursor properties: }
  2166.  
  2167.   bAnsHasLiveFields  = $1;
  2168.   bAnsHasFilter      = $2;
  2169.   bAnsHasFieldMap    = $4;
  2170.   bAnsHasCalcField   = $8;
  2171.   bAnsHasLiveBlob    = $10;
  2172.  
  2173. { answer field properties: }
  2174.  
  2175.   bIsAnsFieldLive    = $1;
  2176.  
  2177. type
  2178.   DBIQryType = (
  2179.     dbiqryDEFAULT,
  2180.     dbiqryDIRTY,
  2181.     dbiqryCLEAN,
  2182.     dbiqryRESTART
  2183.   );
  2184.  
  2185.   pDBIQryProgress = ^DBIQryProgress;
  2186.   DBIQryProgress = packed record
  2187.     stepsInQry      : Word;             { Total steps in query. }
  2188.     stepsCompleted  : Word;             { Steps completed out of total (steps may be skipped). }
  2189.     totElemInStep   : Longint;          { Total elements in current step. }
  2190.     elemCompleted   : Longint;          { Elements completed in current step. }
  2191.   end;
  2192.  
  2193.   QryEvalMode = (
  2194.     qryModeNONE,                        { Reserved }
  2195.     qryModeLOCAL,
  2196.     qryModeSERVER,
  2197.     qryModeEITHER,
  2198.     qryModeNOWLOCAL                     { used only in call back, when failed on server }
  2199.   );
  2200.  
  2201. { values for client indicating live/canned preference about query execution }
  2202.  
  2203.   LIVENESS = (
  2204.     wantDEFAULT,                        { Default , same as wantCANNED }
  2205.     wantLIVE,                           { Want live data even if extra effort (no guarantee) }
  2206.     wantCANNED,                         { Want canned data even if extra effort (guaranteed) }
  2207.     wantSPEED                           { Let query manager decide, find out afterwards }
  2208.   );
  2209.  
  2210.   pQueryLowProps = ^QueryLowProps;
  2211.   QueryLowProps = packed record
  2212.     length          : SmallInt;         { Length in bytes of this structure }
  2213.     blankzeroes     : WordBool;         { TRUE if blanks to be regarded as zeros }
  2214.     dateFormat      : FMTDate;          { Date format }
  2215.     numberFormat    : FMTNumber;        { Number format }
  2216.     bNeedAuxTbls    : WordBool;         { If FALSE, don't bother with DELETED/ERRDEL, etc. }
  2217.     qryMode         : QryEvalMode;      { qryModeSERVER, qryModeLOCAL or qryModeEITHER. }
  2218.     perQrySqlMode   : WordBool;
  2219.     livenessDesired : LIVENESS;
  2220.   end;
  2221.  
  2222. {============================================================================}
  2223. {                      DBI symbols                                           }
  2224. {============================================================================}
  2225.  
  2226. const
  2227.   DBIMOD_BEGIN       = ($3F00);
  2228.  
  2229.   DBIMOD_QBE         = (DBIMOD_BEGIN + 1);
  2230.   DBIMOD_SQLG        = (DBIMOD_BEGIN + 2);
  2231.   DBIMOD_LEGO        = (DBIMOD_BEGIN + 3);
  2232.   DBIMOD_LOCKMNGR    = (DBIMOD_BEGIN + 4);
  2233.   DBIMOD_SQLDRIVER   = (DBIMOD_BEGIN + 5);
  2234.   DBIMOD_OS          = (DBIMOD_BEGIN + 6);
  2235.   DBIMOD_DBASEDRV    = (DBIMOD_BEGIN + 7);
  2236.   DBIMOD_CDR         = (DBIMOD_BEGIN + 8);
  2237.  
  2238.   DBIMOD_END         = (DBIMOD_BEGIN + 9);
  2239.  
  2240. {----------------------------------------------------------------------------}
  2241.  
  2242.   DBISYM_BEGIN       = (DBIMOD_END + 1);
  2243.  
  2244.   DBISYM_TOKEN       = (DBISYM_BEGIN + ecTOKEN);
  2245.   DBISYM_TABLENAME   = (DBISYM_BEGIN + ecTABLENAME);
  2246.   DBISYM_FIELDNAME   = (DBISYM_BEGIN + ecFIELDNAME);
  2247.   DBISYM_IMAGEROW    = (DBISYM_BEGIN + ecIMAGEROW);
  2248.   DBISYM_USERNAME    = (DBISYM_BEGIN + ecUSERNAME);
  2249.   DBISYM_FILENAME    = (DBISYM_BEGIN + ecFILENAME);
  2250.   DBISYM_INDEXNAME   = (DBISYM_BEGIN + ecINDEXNAME);
  2251.   DBISYM_DIRNAME     = (DBISYM_BEGIN + ecDIRNAME);
  2252.   DBISYM_KEYNAME     = (DBISYM_BEGIN + ecKEYNAME);
  2253.   DBISYM_ALIAS       = (DBISYM_BEGIN + ecALIAS);
  2254.   DBISYM_DRIVENAME   = (DBISYM_BEGIN + ecDRIVENAME);
  2255.   DBISYM_NATIVECODE  = (DBISYM_BEGIN + ecNATIVECODE);
  2256.   DBISYM_NATIVEMSG   = (DBISYM_BEGIN + ecNATIVEMSG);
  2257.   DBISYM_LINENUMBER  = (DBISYM_BEGIN + ecLINENUMBER);
  2258.   DBISYM_CAPABILITY  = (DBISYM_BEGIN + ecCAPABILITY);
  2259.   DBISYM_CDRNAME     = (DBISYM_BEGIN + ecCDRNAME);
  2260.   DBISYM_USERERRMSG  = (DBISYM_BEGIN + ecUSERERRMSG);
  2261.   DBISYM_DROBJNAME   = (DBISYM_BEGIN + ecDROBJNAME);
  2262.   DBISYM_INTERNALLIMIT = (DBISYM_BEGIN + ecINTERNALLIMIT);
  2263.   DBISYM_EXPRESSION  = (DBISYM_BEGIN + ecEXPRESSION);
  2264.  
  2265.   DBISYM_BASEEND     = (DBISYM_BEGIN + 100);
  2266.  
  2267. {----------------------------------------------------------------------------}
  2268.  
  2269.   DBISYM_MISC        = (DBISYM_BASEEND + 1);
  2270.  
  2271.   DBISYM_WORK        = (DBISYM_MISC + 1);
  2272.   DBISYM_PRIV        = (DBISYM_MISC + 2);
  2273.   DBISYM_COPY        = (DBISYM_MISC + 3);
  2274.   DBISYM_APPEND      = (DBISYM_MISC + 4);
  2275.   DBISYM_TXTPROBFLD1 = (DBISYM_MISC + 5);
  2276.   DBISYM_TXTPROBFLD2 = (DBISYM_MISC + 6);
  2277.   DBISYM_TXTPROBFLD3 = (DBISYM_MISC + 7);
  2278.  
  2279.  
  2280.   DBISYM_END         = (DBIMOD_BEGIN + $3FFF);
  2281.  
  2282. {============================================================================}
  2283. {                    SQL parsing                                             }
  2284. {============================================================================}
  2285.  
  2286. type
  2287.   SQLType = type TypedEnum;             { Object type. }
  2288. const
  2289.     RELTYPE   = 1;                      { Relation type. }
  2290.     COLTYPE   = 2;                      { Column type. }
  2291.     CONSTYPE  = 3;                      { Constant type. }
  2292.     EXPRTYPE  = 4;                      { Expression type. }
  2293.     AGGRTYPE  = 5;                      { Aggregate type. }
  2294.     CELLTYPE  = 6;                      { Cell type. }
  2295.  
  2296. type
  2297.   REQType = TypedEnum;
  2298. const
  2299.   REQSELECT      = 1;                    { Select. }
  2300.   REQSELECTALL   = 2;                    { Select All. }
  2301.   REQSELECTDIS   = 3;                    { Select Distinct. }
  2302.   REQSELECTDEC   = 4;                    { Select Decending. }
  2303.   REQSELECTCOUNT = 5;                    { Select count(*) }
  2304.   REQDDL         = 6;                    { DDL, create, drop etc. }
  2305.   REQINSERT      = 7;                    { Insert. }
  2306.   REQUPDATE      = 8;                    { Update. }
  2307.   REQDELETE      = 9;                    { Delete. }
  2308.  
  2309.   NAMELENGTH = DBIMAXPATHLEN;
  2310.  
  2311. type
  2312.   pSQLObject = ^SQLObject;
  2313.  
  2314.   pLIST = ^LIST;
  2315.   LIST = packed record
  2316.     car: pSQLObject;                    { SQL Object }
  2317.     cdr: pLIST;                         { Next }
  2318.   end;
  2319.  
  2320.   pSQLRelation = ^SQLRelation;
  2321.   SQLRelation = packed record        { Relation Name structure. }
  2322.     esType: SQLType;                    { value 1 for Relation type. }
  2323.     erType: REQType;                    { Request type, used for t.*. }
  2324.     szRelName: packed array[0..NAMELENGTH] of Char;{ Relation Name. }
  2325.     bRelQuote: Bool;                    { TRUE = Relation Name quoted. }
  2326.     szRelType: packed array[0..NAMELENGTH] of Char;{ Relation Type <Paradox,dBASE,etc> }
  2327.     szRelAlias: packed array[0..NAMELENGTH] of Char;{ Relation Alias. }
  2328.     szRelOwner: packed array[0..NAMELENGTH] of Char;{ Relation Owner. }
  2329.     plCol: pLIST;                       { List of Columns in table. }
  2330.     iRowId: Smallint;                   { Used for Self Joins. }
  2331.     iRowNo: Smallint;                   { Number of rows, 0 based. }
  2332.   end;
  2333.  
  2334.   CHECKType = (                       { Request type. }
  2335.     NOCHECK,                            { No Check. }
  2336.     chkCHECK,                           { Check. }
  2337.     chkCHECKPLUS,                       { Check plus. }
  2338.     chkCHECKDESC                        { Check descending. }
  2339.   );
  2340.  
  2341.   pSQLColumn = ^SQLColumn;
  2342.   SQLColumn = packed record          { Column Name structure. }
  2343.     esType: SQLType;                     { value 2 for Column type. }
  2344.     szColName: packed array[0..NAMELENGTH] of Char;{ Column Name. }
  2345.     bColQuote: Bool;                      { TRUE = Column Name quoted. }
  2346.     szColAlias: packed array[0..NAMELENGTH] of Char;{ Column Alias, if exists. }
  2347.     bColAlQuote: Bool;                    { TRUE = Alias Name quoted. }
  2348.     szColRelation: packed array[0..NAMELENGTH] of Char;{ Relation associated by alias. }
  2349.     szColOwner: packed array[0..NAMELENGTH] of Char;{ Owner of table. }
  2350.     eCheck: CHECKType;                   { Check Mark. }
  2351.     paiRowCheck: PWord;                  { Array of rows which have checks. }
  2352.     iColAggr: Smallint;                  { Column Projected Aggregate. }
  2353.     iColExmpl: Integer;                  { Column Example Element. }
  2354.     plCell: pLIST;                       { List of Cells for each column. }
  2355.   end;
  2356.  
  2357.   pSQLConstant = ^SQLConstant;
  2358.   SQLConstant = packed record        { Constant structure. }
  2359.     esType: SQLType;                    { value 3 for Constant type. }
  2360.     szConstValue: packed array[0..NAMELENGTH] of Char;{ Constant Value. }
  2361.   end;
  2362.  
  2363.   SQLOp = (opUNKNOWNOP, opEQUAL, opNOTEQ, opLESSEQUAL, opGREQUAL, opLESS,
  2364.     opGREATER, opLIKE, opNOT, opPLUSX, opMINUSX, opTIMESX, opDIVX, opAND, opOR,
  2365.     opBLANK, opAS, opOUTERJOIN, opNOTLIKE, opCHANGETO, opUPPER, opLOWER, opTRIM,
  2366.     opSUBSTRING, opPAND, opPOR, opPNOT, opEXTRACT, opFULLOTRJOIN);
  2367.  
  2368.   pSQLExpr = ^SQLExpr;
  2369.   SQLExpr = packed record            { Expression structure. }
  2370.     esType: SQLType;                    { value 4 for Expression type. }
  2371.     eOp: SQLOp;                         { Operator for the Objects. }
  2372.     plOperands: pLIST;                  { Operands, Objects. }
  2373.   end;
  2374.  
  2375.   pSQLAggr = ^SQLAggr;
  2376.   SQLAggr = packed record            { Aggregate structure. }
  2377.     esType: SQLType;                    { value 5 for Aggr. }
  2378.     pcolAggr: pSQLColumn;               { Column where aggr occurs. }
  2379.     iAggr: Smallint;                    { Type of Aggr. }
  2380.     bProjAggr: Bool;                    { Is a Projection Aggr.? }
  2381.     pAggrName: pSQLConstant;            { New Aggr's field name. }
  2382.   end;
  2383.  
  2384.   pSQLCell = ^SQLCell;
  2385.   SQLCell = packed record            { Cell structure. }
  2386.     esType: SQLType;                    { Value 6 for Cell type. }
  2387.     szCellValue: packed array[0..NAMELENGTH] of Char;{ Cell Value. }
  2388.     iRow: Integer;                      { Row number of cell value, 0 based. }
  2389.   end;
  2390.  
  2391.   SQLObject = packed record
  2392.     case Integer of
  2393.      0: (esType: SQLType);
  2394.      1: (pRel: SQLRelation);   {  RELTYPE   (1)  Relation Information. }
  2395.      2: (pCol: SQLColumn);     {  COLTYPE   (2)  Column Information. }
  2396.      3: (pConst: SQLConstant); {  CONSTYPE  (3)  Constant Information. }
  2397.      4: (pExpr: SQLExpr);      {  EXPRTYPE  (4)  Expression Information. }
  2398.      5: (pAggr: SQLAggr);      {  AGGRTYPE  (5)  Aggregate Information. }
  2399.      6: (pCell: SQLCell);      {  CELLTYPE  (6)  Cell Information. }
  2400.   end;
  2401.  
  2402. const
  2403.   REQVERSION         = 3;                { Version of request structure. }
  2404.  
  2405. type
  2406.   PSQLRequest = ^TSQLRequest;
  2407.   TSQLRequest = packed record           { SQL request. }
  2408.     iVersion        : Word;             { Version of request. }
  2409.     iMemMark        : Integer;          { Memory Mark to free request. }
  2410.     hQry            : hDBIQry;          { Query handle for memory mark. }
  2411.     erType          : REQType;          { Request type. }
  2412.     hDb             : hDBIDb;           { Database handle. }
  2413.     hStmt           : hDBIStmt;         { Statement handle used for parameter binding. }
  2414.     iParams         : Integer;          { # of parameters found in SQL statement. }
  2415.     iOptions        : Integer;          { Used for determining which options to set. }
  2416.     iDistinct       : Integer;          { Has "DISTINCT" been specified. }
  2417.     plRelation      : pLIST;            { List of SQLRelation. }
  2418.     plProject       : pLIST;            { List of SQLColumn. }
  2419.     plWhere         : pLIST;            { List of SQLExpr. }
  2420.     plOrder         : pLIST;            { List of SQLColumn. }
  2421.     plGroupBy       : pLIST;            { List of SQLColumn. }
  2422.     plHaving        : pLIST;            { List of SQLObjects. }
  2423.     plAlias         : pLIST;            { List of SQLConstant to represent aliases used. }
  2424.    end;
  2425.  
  2426. {============================================================================}
  2427. {                      DBI Config symbols                                    }
  2428. {============================================================================}
  2429.  
  2430. { Categories }
  2431.  
  2432. const
  2433.   szCFGSYSTEM        = 'SYSTEM';
  2434.   szCFGDRIVER        = 'DRIVERS';
  2435.   szCFGDATABASE      = 'DATABASES';
  2436.   szCFGREPOSITORY    = 'REPOSITORIES';
  2437.  
  2438. {----------------------------------------------------------------------------}
  2439. { System Fields                                                              }
  2440. {----------------------------------------------------------------------------}
  2441.  
  2442.   szCFGSYSVERSION    = 'VERSION';
  2443.   szCFGSYSNETTYPE    = 'NET TYPE';
  2444.   szCFGSYSNETDIR     = 'NET DIR';
  2445.   szCFGSYSLOCALSHARE = 'LOCAL SHARE';
  2446.   szCFGSYSLANGDRV    = 'LANGDRIVER';
  2447.   szCFGSYSLANGDRVDIR = 'LANGDRVDIR';
  2448.   szCFGSYSMINBUF     = 'MINBUFSIZE';
  2449.   szCFGSYSMAXBUF     = 'MAXBUFSIZE';
  2450.   szCFGSYSLOCKRETRY  = 'LOCKRETRY';
  2451.   szCFGSYSFLAGS      = 'SYSFLAGS';
  2452.   szCFGMAXFILEHANDLES = 'MAXFILEHANDLES';
  2453.   szCFGSQLQRYMODE    = 'SQLQRYMODE';
  2454.   szCFGLOWMEMLIMIT   = 'LOW MEMORY USAGE LIMIT'; { Use this instead of NOLOWMEMBUF }
  2455.   szCFGSYSODBCCFGIMPORT = 'AUTO ODBC';
  2456.   szCFGAUTOODBC      = 'AUTO ODBC';
  2457.   szCFGDEFDRV        = 'DEFAULT DRIVER';
  2458.   szCFGSYSLOCALREPOSITORY = 'DATA REPOSITORY';
  2459.   szCFGSYSMEMSIZE    = 'MEMSIZE';
  2460.   szCFGSYSSHAREDMEMSIZE = 'SHAREDMEMSIZE';
  2461.   szCFGSYSSHAREDMEMLOCATION = 'SHAREDMEMLOCATION';
  2462.   szCFGSYSMTSPOOLING = 'MTS POOLING';
  2463.  
  2464. {----------------------------------------------------------------------------}
  2465. { Driver Fields                                                              }
  2466. {----------------------------------------------------------------------------}
  2467.  
  2468.   szCFGDRVVERSION    = 'VERSION';
  2469.   szCFGDRVTYPE       = 'TYPE';
  2470.   szCFGDRVDLL        = 'DLL';
  2471.   szCFGDRVDLL32      = 'DLL32';
  2472.   szCFGDRVFLAGS      = 'DRIVER FLAGS';
  2473.   szCFGDRVLANGDRIVER = 'LANGDRIVER';
  2474.   szCFGDRVFILLFACTOR = 'FILL FACTOR';
  2475.   szCFGDRVBLOCKSIZE  = 'BLOCK SIZE';
  2476.   szCFGDRVLOCKPROTOCOL = 'LOCKPROTOCOL';
  2477.   szCFGDRVLEVEL      = 'LEVEL';
  2478.   szCFGDRVVENDINIT   = 'VENDOR INIT';
  2479.   szCFGDRVTRACEMODE  = 'TRACE MODE';
  2480.  
  2481. {----------------------------------------------------------------------------}
  2482. { Dbase Driver fields                                                        }
  2483. {----------------------------------------------------------------------------}
  2484.  
  2485.   szCFGDRVMEMOBLOCKSIZE = 'MEMO FILE BLOCK SIZE';
  2486.   szCFGDRVMDXBLOCKSIZE = 'MDX BLOCK SIZE';
  2487.  
  2488.  
  2489. {----------------------------------------------------------------------------}
  2490. { Driver Nodes                                                               }
  2491. {----------------------------------------------------------------------------}
  2492.  
  2493.   szCFGDRVINIT       = 'INIT';
  2494.   szCFGDBCREATE      = 'DB CREATE';
  2495.   szCFGDBOPEN        = 'DB OPEN';
  2496.   szCFGTBLCREATE     = 'TABLE CREATE';
  2497.   szCFGTBLOPEN       = 'TABLE OPEN';
  2498.  
  2499. {----------------------------------------------------------------------------}
  2500. { Database Nodes                                                             }
  2501. {----------------------------------------------------------------------------}
  2502.  
  2503.   szCFGDBINFO        = 'DB INFO';
  2504.  
  2505. {----------------------------------------------------------------------------}
  2506. { Database fields                                                            }
  2507. {----------------------------------------------------------------------------}
  2508.  
  2509.   szCFGDBTYPE        = 'TYPE';
  2510.   szCFGDBPATH        = 'PATH';
  2511.   szCFGDBDEFAULTDRIVER = 'DEFAULT DRIVER';
  2512.   szCFGDBENABLEBCD   = 'ENABLE BCD';
  2513.  
  2514. {----------------------------------------------------------------------------}
  2515. { Others                                                                     }
  2516. {----------------------------------------------------------------------------}
  2517.  
  2518.   szCFGINIT          = 'INIT';
  2519.   szTYPe             = 'TYPE';  { Changed from szTYPE to avoid urlmon.h conflict }
  2520.   szCFGDBSTANDARD    = 'STANDARD';
  2521.   szCFGTRUE          = 'TRUE';
  2522.   szCFGFALSE         = 'FALSE';
  2523.   szOPENMODE         = 'OPEN MODE';
  2524.   szREADWRITE        = 'READ/WRITE';
  2525.   szREADONLY         = 'READ ONLY';
  2526.   szSHAREMODE        = 'SHARE MODE';
  2527.   szEXCLUSIVE        = 'EXCLUSIVE';
  2528.   szSHARED           = 'SHARED';
  2529.   szUSERNAME         = 'USER NAME';
  2530.   szPASSWORD         = 'PASSWORD';
  2531.   szSERVERNAME       = 'SERVER NAME';
  2532.   szDATABASENAME     = 'DATABASE NAME';
  2533.   szSCHEMASIZE       = 'SCHEMA CACHE SIZE';
  2534.   szCFGSTRICTINTEGRITY = 'STRICTINTEGRTY';
  2535.   szSQLPASSMODE      = 'SQLPASSTHRU MODE';
  2536.   szNOTSHARED        = 'NOT SHARED';
  2537.   szSHAREDAUTOCOMMIT = 'SHARED AUTOCOMMIT';
  2538.   szSHAREDNOAUTOCOMMIT = 'SHARED NOAUTOCOMMIT';
  2539.   szSCHEMATIME       = 'SCHEMA CACHE TIME';
  2540.   szMAXQUERYTIME     = 'MAX QUERY TIME';
  2541.   szMAXROWS          = 'MAX ROWS';
  2542.   szLISTSYNONYMS     = 'LIST SYNONYMS';
  2543.   szSYNNONE          = 'NONE';
  2544.   szSYNALL           = 'ALL';
  2545.   szSYNPRIVATE       = 'PRIVATE';
  2546.   szBATCHCOUNT       = 'BATCH COUNT';
  2547.   szBLOBCOUNT        = 'BLOBS TO CACHE'; 
  2548.   szBLOBSIZE         = 'BLOB SIZE';
  2549.   szOBJECTMODE       = 'OBJECT MODE';
  2550.   szENABLESCHEMACACHE= 'ENABLE SCHEMA CACHE';
  2551.   szSCHEMACACHEDIR   = 'SCHEMA CACHE DIR';
  2552.   szSYBLHOST         = 'HOST NAME';
  2553.   szSYBLAPP          = 'APPLICATION NAME';
  2554.   szSYBLNATLANG      = 'NATIONAL LANG NAME';
  2555.   szTDSPACKETSIZE    = 'TDS PACKET SIZE';
  2556.   szORAINTEGER       = 'ENABLE INTEGERS';
  2557.   szDBNLS            = 'DBNLS';
  2558.   szCOLLCHAR         = 'COLLCHAR';
  2559.   szROWSETSIZE       = 'ROWSET SIZE';
  2560.   szCFG30            = '5.0';
  2561.   szCFGSERVER        = 'SERVER';
  2562.   szCFGIDODBC01      = 'IDODBC01.DLL';
  2563.   szCFGIDODBC32      = 'IDODBC32.DLL';
  2564.   szCFGODBCDRIVER    = 'ODBC DRIVER';
  2565.   szCFGNULL          = '';
  2566.   szCFGZERO          = '0';
  2567.   szCFG20            = '20';
  2568.   szCFG64            = '64';
  2569.   szCFG32            = '32';
  2570.   szCFGODBCDSN       = 'ODBC DSN';
  2571.   szCFGTWOHUNDRED    = '200';
  2572.   szCFGNEGONE        = '-1';
  2573.   szCFGEIGHT         = '8';
  2574.   szCLSID            = 'CLSID';
  2575.   szCFGSYSTEMDB      = 'SYSTEM DATABASE';
  2576.   szCFGOLEDBPROVIDER = 'OLE DB PROVIDER';
  2577.   szCFGPERSISTFILE   = 'DATA SOURCE FILE';
  2578.   szCFGOBJECTMODE    = 'OBJECT MODE';
  2579.  
  2580. {----------------------------------------------------------------------------}
  2581. { Repository fields                                                          }
  2582. {----------------------------------------------------------------------------}
  2583.  
  2584.   szCFGDRDBNAME      = 'DATABASE NAME';
  2585.   szCFGDRTBLNAME     = 'TABLE NAME';
  2586.   szCFGDRLANGDRIVER  = 'LANGUAGE DRIVER';
  2587.   szCFGDRDESC        = 'DESCRIPTION';
  2588.  
  2589. {----------------------------------------------------------------------------}
  2590. { SYSTEM DATE/TIME/NUMBER FORMATS                                            }
  2591. { SYSTEM nodes:                                                              }
  2592. {----------------------------------------------------------------------------}
  2593.  
  2594.   szCFGFORMAT        = 'FORMATS';
  2595.  
  2596. {----------------------------------------------------------------------------}
  2597. { Format nodes:                                                              }
  2598. {----------------------------------------------------------------------------}
  2599.  
  2600.   szCFGDATE          = 'DATE';
  2601.   szCFGTIME          = 'TIME';
  2602.   szCFGNUMBER        = 'NUMBER';
  2603.  
  2604. {----------------------------------------------------------------------------}
  2605. { DATE and/or TIME fields:                                                   }
  2606. {----------------------------------------------------------------------------}
  2607.  
  2608.   szCFGSEPARATOR     = 'SEPARATOR';
  2609.   szCFGMODE          = 'MODE';
  2610.   szCFGFOURDIGITYEAR = 'FOURDIGITYEAR';
  2611.   szCFGYEARBIASED    = 'YEARBIASED';
  2612.   szCFGLEADINGZEROM  = 'LEADINGZEROM';
  2613.   szCFGLEADINGZEROD  = 'LEADINGZEROD';
  2614.   szCFGTWELVEHOUR    = 'TWELVEHOUR';
  2615.   szCFGAMSTRING      = 'AMSTRING';
  2616.   szCFGPMSTRING      = 'PMSTRING';
  2617.   szCFGSECONDS       = 'SECONDS';
  2618.   szCFGMILSECONDS    = 'MILSECONDS';
  2619.  
  2620. {----------------------------------------------------------------------------}
  2621. { Number fields:                                                             }
  2622. {----------------------------------------------------------------------------}
  2623.  
  2624.   szCFGDECIMALSEPARATOR = 'DECIMALSEPARATOR';
  2625.   szCFGTHOUSANDSEPARATOR = 'THOUSANDSEPARATOR';
  2626.   szCFGDECIMALDIGITS = 'DECIMALDIGITS';
  2627.   szCFGLEADINGZERON  = 'LEADINGZERON';
  2628.  
  2629. { String resoure id's for each string listed above }
  2630.  
  2631.   DBICFG_BASE        = $3A00;
  2632.  
  2633. {----------------------------------------------------------------------------}
  2634. { Categories                                                                 }
  2635. {----------------------------------------------------------------------------}
  2636.  
  2637.   iCFGSYSTEM         = (DBICFG_BASE + 1);
  2638.   iCFGDRIVER         = (DBICFG_BASE + 2);
  2639.   iCFGDATABASE       = (DBICFG_BASE + 3);
  2640.   iCFGREPOSITORY     = (DBICFG_BASE + 210);
  2641.  
  2642. {----------------------------------------------------------------------------}
  2643. { System Fields                                                              }
  2644. {----------------------------------------------------------------------------}
  2645.  
  2646.   iCFGSYSVERSION     = (DBICFG_BASE + 5);
  2647.   iCFGSYSNETTYPE     = (DBICFG_BASE + 6);
  2648.   iCFGSYSNETDIR      = (DBICFG_BASE + 7);
  2649.   iCFGSYSLOCALSHARE  = (DBICFG_BASE + 8);
  2650.   iCFGSYSLANGDRV     = (DBICFG_BASE + 9);
  2651.   iCFGSYSLANGDRVDIR  = (DBICFG_BASE + 10);
  2652.   iCFGSYSMINBUF      = (DBICFG_BASE + 11);
  2653.   iCFGSYSMAXBUF      = (DBICFG_BASE + 12);
  2654.   iCFGSYSLOCKRETRY   = (DBICFG_BASE + 13);
  2655.   iCFGSYSFLAGS       = (DBICFG_BASE + 14);
  2656.   iCFGMAXFILEHANDLES = (DBICFG_BASE + 15);
  2657.   iCFGSQLQRYMODE     = (DBICFG_BASE + 16);
  2658.   iCFGLOWMEMLIMIT    = (DBICFG_BASE + 17);
  2659.   iCFGSYSODBCCFGIMPORT = (DBICFG_BASE + 18);
  2660.   iCFGSYSLOCALREPOSITORY = (DBICFG_BASE + 211);
  2661.   iCFGSYSSHAREDMEMSIZE = (DBICFG_BASE + 250);
  2662.   iCFGSYSSHAREDMEMLOCATION = (DBICFG_BASE + 251);
  2663.   iCFGSYSMEMSIZE     = DBICFG_BASE + 125;
  2664.  
  2665.  
  2666. {----------------------------------------------------------------------------}
  2667. { Driver Fields                                                              }
  2668. {----------------------------------------------------------------------------}
  2669.  
  2670.   iCFGDRVVERSION     = (DBICFG_BASE + 20);
  2671.   iCFGDRVTYPE        = (DBICFG_BASE + 21);
  2672.   iCFGDRVLANGDRIVER  = (DBICFG_BASE + 22);
  2673.   iCFGDRVFILLFACTOR  = (DBICFG_BASE + 23);
  2674.   iCFGDRVBLOCKSIZE   = (DBICFG_BASE + 24);
  2675.   iCFGDRVLOCKPROTOCOL = (DBICFG_BASE + 25);
  2676.   iCFGDRVLEVEL       = (DBICFG_BASE + 26);
  2677.   iCFGDRVFLAGS       = (DBICFG_BASE + 27);
  2678.   iCFGDRVTRACEMODE   = (DBICFG_BASE + 28);
  2679.   iCFGDRVDLL32       = (DBICFG_BASE + 29);
  2680.  
  2681. {----------------------------------------------------------------------------}
  2682. { Dbase Driver fields                                                        }
  2683. {----------------------------------------------------------------------------}
  2684.  
  2685.   iCFGDRVMEMOBLOCKSIZE = (DBICFG_BASE + 30 );
  2686.   iCFGDRVMDXBLOCKSIZE = (DBICFG_BASE + 31 );
  2687.  
  2688. {----------------------------------------------------------------------------}
  2689. { Driver Nodes                                                               }
  2690. {----------------------------------------------------------------------------}
  2691.  
  2692.   iCFGDRVINIT        = (DBICFG_BASE + 40 );
  2693.   iCFGDBCREATE       = (DBICFG_BASE + 41 );
  2694.   iCFGDBOPEN         = (DBICFG_BASE + 42 );
  2695.   iCFGTBLCREATE      = (DBICFG_BASE + 43 );
  2696.   iCFGTBLOPEN        = (DBICFG_BASE + 44 );
  2697.  
  2698. {----------------------------------------------------------------------------}
  2699. { Database Nodes                                                             }
  2700. {----------------------------------------------------------------------------}
  2701.  
  2702.   iCFGDBINFO         = (DBICFG_BASE + 50 );
  2703.  
  2704. {----------------------------------------------------------------------------}
  2705. { Database fields                                                            }
  2706. {----------------------------------------------------------------------------}
  2707.  
  2708.   iCFGDBTYPE         = (DBICFG_BASE + 60);
  2709.   iCFGDBPATH         = (DBICFG_BASE + 61);
  2710.   iCFGDBDEFAULTDRIVER = (DBICFG_BASE + 62);
  2711.   iCFGDBENABLEBCD    = (DBICFG_BASE + 63);
  2712.  
  2713. {----------------------------------------------------------------------------}
  2714. { Others                                                                     }
  2715. {----------------------------------------------------------------------------}
  2716.  
  2717.   iCFGINIT           = (DBICFG_BASE + 70);
  2718.   iTYPE              = (DBICFG_BASE + 71);
  2719.   iCFGDBSTANDARD     = (DBICFG_BASE + 72);
  2720.   iCFGTRUE           = (DBICFG_BASE + 73);
  2721.   iCFGFALSE          = (DBICFG_BASE + 74);
  2722.   iOPENMODE          = (DBICFG_BASE + 75);
  2723.   iREADWRITE         = (DBICFG_BASE + 76);
  2724.   iREADONLY          = (DBICFG_BASE + 77);
  2725.   iSHAREMODE         = (DBICFG_BASE + 78);
  2726.   iEXCLUSIVE         = (DBICFG_BASE + 79);
  2727.   iSHARED            = (DBICFG_BASE + 80);
  2728.   iUSERNAME          = (DBICFG_BASE + 81);
  2729.   iSERVERNAME        = (DBICFG_BASE + 82);
  2730.   iDATABASENAME      = (DBICFG_BASE + 83);
  2731.   iSCHEMASIZE        = (DBICFG_BASE + 84);
  2732.   iCFGSTRICTINTEGRITY = (DBICFG_BASE + 85);
  2733.   iTDSPACKETSIZE     = (DBICFG_BASE + 86);
  2734.   iORAINTEGER        = (DBICFG_BASE + 87);
  2735.   iDBNLS             = (DBICFG_BASE + 88);
  2736.   iCOLLCHAR          = (DBICFG_BASE + 89);
  2737.   { numbers 90-122 used in dbiext.h }
  2738.   iROWSETSIZE        = (DBICFG_BASE + 134);
  2739.   iCFGOBJECTMODE     = DBICFG_BASE + 135; 
  2740.  
  2741. {----------------------------------------------------------------------------}
  2742. { Repository Nodes                                                           }
  2743. {----------------------------------------------------------------------------}
  2744.  
  2745.   iCFGDRDBNAME       = (DBICFG_BASE + 213);
  2746.   iCFGDRTBLNAME      = (DBICFG_BASE + 214);
  2747.   iCFGDRDESC         = (DBICFG_BASE + 215);
  2748.   iCFGDRLANGDRIVER   = (DBICFG_BASE + 212);
  2749.  
  2750. {----------------------------------------------------------------------------}
  2751. { System node:                                                               }
  2752. {----------------------------------------------------------------------------}
  2753.  
  2754.   iCFGFORMAT         = (DBICFG_BASE + 130);
  2755.  
  2756. {----------------------------------------------------------------------------}
  2757. { Format nodes:                                                              }
  2758. {----------------------------------------------------------------------------}
  2759.  
  2760.   iCFGDATE           = (DBICFG_BASE + 131);
  2761.   iCFGTIME           = (DBICFG_BASE + 132);
  2762.   iCFGNUMBER         = (DBICFG_BASE + 133);
  2763.  
  2764. {----------------------------------------------------------------------------}
  2765. { DATE and/or TIME fields:                                                   }
  2766. {----------------------------------------------------------------------------}
  2767.  
  2768.   iCFGSEPARATOR      = (DBICFG_BASE + 140);
  2769.   iCFGMODE           = (DBICFG_BASE + 141);
  2770.   iCFGFOURDIGITYEAR  = (DBICFG_BASE + 142);
  2771.   iCFGYEARBIASED     = (DBICFG_BASE + 143);
  2772.   iCFGLEADINGZEROM   = (DBICFG_BASE + 144);
  2773.   iCFGLEADINGZEROD   = (DBICFG_BASE + 145);
  2774.   iCFGTWELVEHOUR     = (DBICFG_BASE + 146);
  2775.   iCFGAMSTRING       = (DBICFG_BASE + 147);
  2776.   iCFGPMSTRING       = (DBICFG_BASE + 148);
  2777.   iCFGSECONDS        = (DBICFG_BASE + 149);
  2778.   iCFGMILSECONDS     = (DBICFG_BASE + 150);
  2779.  
  2780. {----------------------------------------------------------------------------}
  2781. { Number fields:                                                             }
  2782. {----------------------------------------------------------------------------}
  2783.  
  2784.   iCFGDECIMALSEPARATOR  = (DBICFG_BASE + 160);
  2785.   iCFGTHOUSANDSEPARATOR = (DBICFG_BASE + 161);
  2786.   iCFGDECIMALDIGITS     = (DBICFG_BASE + 162);
  2787.   iCFGLEADINGZERON      = (DBICFG_BASE + 163);
  2788.  
  2789.   iCFGDEFLANGDRV        = (DBICFG_BASE + 165);
  2790.   iCFGDBASEDEFLANGDRV   = (DBICFG_BASE + 166);
  2791.  
  2792. {----------------------------------------------------------------------------}
  2793. { Formats                                                                    }
  2794. {----------------------------------------------------------------------------}
  2795.  
  2796.   iCFGDEFSEPARATOR          = (DBICFG_BASE + 170);
  2797.   iCFGDEFMODE               = (DBICFG_BASE + 171);
  2798.   iCFGDEFFOURDIGITYEAR      = (DBICFG_BASE + 172);
  2799.   iCFGDEFYEARBIASED         = (DBICFG_BASE + 173);
  2800.   iCFGDEFLEADINGZEROM       = (DBICFG_BASE + 174);
  2801.   iCFGDEFLEADINGZEROD       = (DBICFG_BASE + 175);
  2802.   iCFGDEFTWELVEHOUR         = (DBICFG_BASE + 176);
  2803.   iCFGDEFAMSTRING           = (DBICFG_BASE + 177);
  2804.   iCFGDEFPMSTRING           = (DBICFG_BASE + 178);
  2805.   iCFGDEFSECONDS            = (DBICFG_BASE + 179);
  2806.   iCFGDEFMILSECONDS         = (DBICFG_BASE + 180);
  2807.   iCFGDEFDECIMALSEPARATOR   = (DBICFG_BASE + 181);
  2808.   iCFGDEFTHOUSANDSEPARATOR  = (DBICFG_BASE + 182);
  2809.   iCFGDEFLEADINGZERO        = (DBICFG_BASE + 183);
  2810.  
  2811.   iCFGDEFVERSION            = (DBICFG_BASE + 184);
  2812.   iCFGDEFLOCALSHARE         = (DBICFG_BASE + 185);
  2813.   iCFGDEFMINBUFSIZE         = (DBICFG_BASE + 186);
  2814.   iCFGDEFMAXBUFSIZE         = (DBICFG_BASE + 187);
  2815.   iCFGDEFMAXFILEHANDLES     = (DBICFG_BASE + 188);
  2816.   iCFGDEFSYSFLAGS           = (DBICFG_BASE + 189);
  2817.   iCFGDEFLOWMEM             = (DBICFG_BASE + 190);
  2818.   iCFGDEFAUTOODBC           = (DBICFG_BASE + 191);
  2819.   iCFGDEFDEFDRV             = (DBICFG_BASE + 192);
  2820.  
  2821.   iCFGDEFDECIMALDIGITS      = (DBICFG_BASE + 193);
  2822.   iCFGDEFLEADINGZERON       = (DBICFG_BASE + 194);
  2823.  
  2824.   iCFGDEFPDXTYPE            = (DBICFG_BASE + 195);
  2825.   iCFGDEFPDXNETDIR          = (DBICFG_BASE + 196);
  2826.   iCFGDEFPDXLANGDRV         = (DBICFG_BASE + 197);
  2827.   iCFGDEFPDXLEVEL           = (DBICFG_BASE + 198);
  2828.   iCFGDEFPDXBLOCKSIZE       = (DBICFG_BASE + 199);
  2829.   iCFGDEFPDXFILLFACTOR      = (DBICFG_BASE + 200);
  2830.   iCFGDEFPDXSTRICTINTEGRTY  = (DBICFG_BASE + 201);
  2831.  
  2832.   iCFGDEFDBASETYPE          = (DBICFG_BASE + 202);
  2833.   iCFGDEFDBASELANGDRV       = (DBICFG_BASE + 203);
  2834.   iCFGDEFDBASELEVEL         = (DBICFG_BASE + 204);
  2835.   iCFGDEFDBASEMDXBLOCKSIZE  = (DBICFG_BASE + 205);
  2836.   iCFGDEFDBASEMEMOBLOCKSIZE = (DBICFG_BASE + 206);
  2837.  
  2838.   iCFGAUTOODBC              = (DBICFG_BASE + 207);
  2839.   iCFGDEFDRV                = (DBICFG_BASE + 208);
  2840.   iCFGENABLEBCD             = (DBICFG_BASE + 209);
  2841.   iCFGDEFSHAREDMEMSIZE      = (DBICFG_BASE + 252);
  2842.   iCFGDEFSHAREDMEMLOCATION  = (DBICFG_BASE + 253);
  2843.   iCFGDEFREPOSITORY         = (DBICFG_BASE + 254);
  2844.   iCFGDEFSQLQRYMODE         = (DBICFG_BASE + 255);
  2845.   iCFGDEFMEMSIZE            = (DBICFG_BASE + 126); 
  2846.  
  2847. { MSACCESS default driver field values }
  2848.   iCFGDEFMSACCESSVER        = (DBICFG_BASE + 220);
  2849.   iCFGDEFMSACCESSTYPE       = (DBICFG_BASE + 221);
  2850.   iCFGDEFMSACCESSDLL32      = (DBICFG_BASE + 222);
  2851.   iCFGDEFMSACCESSLANGDRV    = (DBICFG_BASE + 223);
  2852.   iCFGDEFDATABASENAME       = (DBICFG_BASE + 224);
  2853.   iCFGDEFUSERNAME           = (DBICFG_BASE + 225);
  2854.   iCFGDEFTRACEMODE          = (DBICFG_BASE + 226);
  2855.   iCFGDEFDRVFLAGS           = (DBICFG_BASE + 227);
  2856.   iCFGCFGSYSTEMDB           = (DBICFG_BASE + 231);
  2857.  
  2858. { FOXPRO default driver field values }
  2859.   iCFGDEFFOXPROTYPE         = (DBICFG_BASE + 228);
  2860.   iCFGDEFFOXPROLANGDRV      = (DBICFG_BASE + 229);
  2861.   iCFGDEFFOXPROLEVEL        = (DBICFG_BASE + 230);
  2862.  
  2863.  
  2864.  
  2865.   CFGHLP_BASE               = $3B00;
  2866.  
  2867.   iCFGHLP_SYSNODE           = (CFGHLP_BASE +1);
  2868.   iCFGHLP_SYSINITNODE       = (CFGHLP_BASE +2);
  2869.   iCFGHLP_SYSVERSION        = (CFGHLP_BASE +3);
  2870.   iCFGHLP_SYSLOCALSHARE     = (CFGHLP_BASE +4);
  2871.   iCFGHLP_SYSMINBUFSIZE     = (CFGHLP_BASE +5);
  2872.   iCFGHLP_SYSMAXBUFSIZE     = (CFGHLP_BASE +6);
  2873.   iCFGHLP_SYSLANGDRIVER     = (CFGHLP_BASE +7);
  2874.   iCFGHLP_SYSNETTYPE        = (CFGHLP_BASE +8);
  2875.   iCFGHLP_SYSFLAGS          = (CFGHLP_BASE +9);
  2876.   iCFGHLP_SYSMAXFILE        = (CFGHLP_BASE +10);
  2877.   iCFGHLP_SYSLOWMEM         = (CFGHLP_BASE +11);
  2878.   iCFGHLP_SYSAUTOODBC       = (CFGHLP_BASE +12);
  2879.   iCFGHLP_SYSDEFDRV         = (CFGHLP_BASE +13);
  2880.   iCFGHLP_SYSSQLQRYMODE     = (CFGHLP_BASE +14);
  2881.   iCFGHLP_SYSSQLPASSTHRU    = (CFGHLP_BASE +15);
  2882.   iCFGHLP_SYSFORMATNODE     = (CFGHLP_BASE +16);
  2883.   iCFGHLP_DATENODE          = (CFGHLP_BASE +17);
  2884.   iCFGHLP_DATESEPARATOR     = (CFGHLP_BASE +18);
  2885.   iCFGHLP_DATEMODE          = (CFGHLP_BASE +19);
  2886.   iCFGHLP_DATEFOURDIGIT     = (CFGHLP_BASE +20);
  2887.   iCFGHLP_DATEYEARBIASED    = (CFGHLP_BASE +21);
  2888.   iCFGHLP_DATEZEROM         = (CFGHLP_BASE +22);
  2889.   iCFGHLP_DATEZEROD         = (CFGHLP_BASE +23);
  2890.   iCFGHLP_TIMENODE          = (CFGHLP_BASE +24);
  2891.   iCFGHLP_TIMETWELVEHOUR    = (CFGHLP_BASE +25);
  2892.   iCFGHLP_TIMEAMSTRING      = (CFGHLP_BASE +26);
  2893.   iCFGHLP_TIMEPMSTRING      = (CFGHLP_BASE +27);
  2894.   iCFGHLP_TIMESECONDS       = (CFGHLP_BASE +28);
  2895.   iCFGHLP_TIMEMILSEC        = (CFGHLP_BASE +29);
  2896.   iCFGHLP_NUMNODE           = (CFGHLP_BASE +30);
  2897.   iCFGHLP_NUMDECIMALSEPARATOR = (CFGHLP_BASE +31);
  2898.   iCFGHLP_NUMTHOUSANDSEPARATOR = (CFGHLP_BASE +32);
  2899.   iCFGHLP_NUMDECIMALDIGITS  = (CFGHLP_BASE +33);
  2900.   iCFGHLP_NUMZERON          = (CFGHLP_BASE +34);
  2901.   iCFGHLP_DRVNODE           = (CFGHLP_BASE +35);
  2902.   iCFGHLP_PDXNODE           = (CFGHLP_BASE +36);
  2903.   iCFGHLP_PDXINITNODE       = (CFGHLP_BASE +37);
  2904.   iCFGHLP_DRVTYPE           = (CFGHLP_BASE +38);
  2905.   iCFGHLP_PDXNETDIR         = (CFGHLP_BASE +39);
  2906.   iCFGHLP_PDXTBLNODE        = (CFGHLP_BASE +40);
  2907.   iCFGHLP_PDXLEVEL          = (CFGHLP_BASE +41);
  2908.   iCFGHLP_PDXBLOCKSIZE      = (CFGHLP_BASE +42);
  2909.   iCFGHLP_PDXFILLFACTOR     = (CFGHLP_BASE +43);
  2910.   iCFGHLP_PDXSTRICT         = (CFGHLP_BASE +44);
  2911.   iCFGHLP_DBNODE            = (CFGHLP_BASE +45);
  2912.   iCFGHLP_DBINITNODE        = (CFGHLP_BASE +46);
  2913.   iCFGHLP_DBVERSION         = (CFGHLP_BASE +47);
  2914.   iCFGHLP_DBTBLNODE         = (CFGHLP_BASE +48);
  2915.   iCFGHLP_DBLEVEL           = (CFGHLP_BASE +49);
  2916.   iCFGHLP_DBMDXBLOCKSIZE    = (CFGHLP_BASE +50);
  2917.   iCFGHLP_DBMEMOFILEBLOCKSIZE = (CFGHLP_BASE +51);
  2918.   iCFGHLP_INTNODE           = (CFGHLP_BASE +52);
  2919.   iCFGHLP_INTINITNODE       = (CFGHLP_BASE +53);
  2920.   iCFGHLP_INTVERSION        = (CFGHLP_BASE +54);
  2921.   iCFGHLP_SQLDLL            = (CFGHLP_BASE +55);
  2922.   iCFGHLP_SQLDLL32          = (CFGHLP_BASE +56);
  2923.   iCFGHLP_SQLDRIVERFLAGS    = (CFGHLP_BASE +57);
  2924.   iCFGHLP_INTDBNODE         = (CFGHLP_BASE +58);
  2925.   iCFGHLP_SQLSERVER         = (CFGHLP_BASE +59);
  2926.   iCFGHLP_SQLUSER           = (CFGHLP_BASE +60);
  2927.   iCFGHLP_SQLOPENMODE       = (CFGHLP_BASE +61);
  2928.   iCFGHLP_SQLSCHEMASIZE     = (CFGHLP_BASE +62);
  2929.   iCFGHLP_SQLSCHEMATIME     = (CFGHLP_BASE +63);
  2930.   iCFGHLP_SYBNODE           = (CFGHLP_BASE +64);
  2931.   iCFGHLP_SYBINITNODE       = (CFGHLP_BASE +65);
  2932.   iCFGHLP_SYBVERSION        = (CFGHLP_BASE +66);
  2933.   iCFGHLP_SQLCONNECT        = (CFGHLP_BASE +67);
  2934.   iCFGHLP_SQLTIMEOUT        = (CFGHLP_BASE +68);
  2935.   iCFGHLP_SYBDBNODE         = (CFGHLP_BASE +69);
  2936.   iCFGHLP_SQLDATABASE       = (CFGHLP_BASE +70);
  2937.   iCFGHLP_SQLBLOBEDIT       = (CFGHLP_BASE +71);
  2938.   iCFGHLP_SQLMAXQUERY       = (CFGHLP_BASE +72);
  2939.   iCFGHLP_ORANODE           = (CFGHLP_BASE +73);
  2940.   iCFGHLP_ORAINITNODE       = (CFGHLP_BASE +74);
  2941.   iCFGHLP_ORAVERSION        = (CFGHLP_BASE +75);
  2942.   iCFGHLP_SQLVENDOR         = (CFGHLP_BASE +76);
  2943.   iCFGHLP_ORADBNODE         = (CFGHLP_BASE +77);
  2944.   iCFGHLP_SQLNETPROTOCOL    = (CFGHLP_BASE +78);
  2945.   iCFGHLP_MSSNODE           = (CFGHLP_BASE +79);
  2946.   iCFGHLP_MSSINITNODE       = (CFGHLP_BASE +80);
  2947.   iCFGHLP_MSSVERSION        = (CFGHLP_BASE +81);
  2948.   iCFGHLP_MSSDBNODE         = (CFGHLP_BASE +82);
  2949.   iCFGHLP_INFNODE           = (CFGHLP_BASE +83);
  2950.   iCFGHLP_INFINITNODE       = (CFGHLP_BASE +84);
  2951.   iCFGHLP_INFVERSION        = (CFGHLP_BASE +85);
  2952.   iCFGHLP_INFDBNODE         = (CFGHLP_BASE +86);
  2953.   iCFGHLP_SQLLOCKMODE       = (CFGHLP_BASE +87);
  2954.   iCFGHLP_SQLTRACEMODE      = (CFGHLP_BASE +88);
  2955.   iCFGHLP_SQLMAXROWS        = (CFGHLP_BASE +89);
  2956.   iCFGHLP_SQLBATCHCOUNT     = (CFGHLP_BASE +90);
  2957.   iCFGHLP_SYSSHAREDMEMSIZ   = (CFGHLP_BASE +91);
  2958.   iCFGHLP_SYSSHAREDMEMLOC   = (CFGHLP_BASE +92);
  2959.   iCFGHLP_SYSDATAREP        = (CFGHLP_BASE +93);
  2960.   iCFGHLP_ALIASTYPE         = (CFGHLP_BASE +94);
  2961.   iCFGHLP_ALIASPATH         = (CFGHLP_BASE +95);
  2962.   iCFGHLP_ALIASDEFDRV       = (CFGHLP_BASE +96);
  2963.   iCFGHLP_ENABLESCHEMACACHE = (CFGHLP_BASE +97);
  2964.   iCFGHLP_SCHEMACACHEDIR    = (CFGHLP_BASE +98);
  2965.   iCFGHLP_HOSTNAME          = (CFGHLP_BASE +99);
  2966.   iCFGHLP_APPLICATIONNAME   = (CFGHLP_BASE +100);
  2967.   iCFGHLP_NATIONALLANGNAME  = (CFGHLP_BASE +101);
  2968.   iCFGHLP_ALIASENABLEBCD    = (CFGHLP_BASE +102);
  2969.   iCFGHLP_TDSPACKETSIZE     = (CFGHLP_BASE +103);
  2970.   iCFGHLP_ORAINTEGER        = (CFGHLP_BASE +104);
  2971.   iCFGHLP_ORALISTSYNONYMS   = (CFGHLP_BASE +105);
  2972.   iCFGHLP_ROWSETSIZE        = (CFGHLP_BASE +106);
  2973.   iCFGHLP_DB2DRIVER         = (CFGHLP_BASE +107);
  2974.   iCFGHLP_DB2DSN            = (CFGHLP_BASE +108);
  2975.   iCFGHLP_DB2NODE           = (CFGHLP_BASE +109);
  2976.   iCFGHLP_DB2INITNODE       = (CFGHLP_BASE +110);
  2977.   iCFGHLP_DB2VERSION        = (CFGHLP_BASE +111);
  2978.   iCFGHLP_DB2DBNODE         = (CFGHLP_BASE +112);
  2979.   iCFGHLP_COLLCHAR          = (CFGHLP_BASE +113);
  2980.   iCFGHLP_DBNLS             = (CFGHLP_BASE +114);
  2981.   iCFGHLP_MSACCNODE         = (CFGHLP_BASE +115);
  2982.   iCFGHLP_MSACCINITNODE     = (CFGHLP_BASE +116);
  2983.   iCFGHLP_MSACCVERSION      = (CFGHLP_BASE +117);
  2984.   iCFGHLP_MSACCDBNODE       = (CFGHLP_BASE +118);
  2985.   iCFGHLP_ODBCDRIVER        = (CFGHLP_BASE +119);
  2986.   iCFGHLP_ODBCVERSION       = (CFGHLP_BASE +120);
  2987.   iCFGHLP_ODBCDSN           = (CFGHLP_BASE +121);
  2988.   iCFGHLP_OLEVERSION        = (CFGHLP_BASE +122);
  2989.   iCFGHLP_OLECLSID          = (CFGHLP_BASE +123);
  2990.   iCFGHLP_BLOBSTOCACHE      = (CFGHLP_BASE +124);
  2991.   iCFGHLP_BLOBSIZE          = (CFGHLP_BASE +125);
  2992.   iCFGHLP_SYSMEMSIZE        = (CFGHLP_BASE +126);
  2993.   iCFGHLP_MAXDBPROCS        = (CFGHLP_BASE +127);
  2994.   iCFGHLP_FPNODE            = (CFGHLP_BASE +128);
  2995.   iCFGHLP_FPINITNODE        = (CFGHLP_BASE +129);
  2996.   iCFGHLP_FPVERSION         = (CFGHLP_BASE +130);
  2997.   iCFGHLP_FPTBLNODE         = (CFGHLP_BASE +131);
  2998.   iCFGHLP_FPLEVEL           = (CFGHLP_BASE +132);
  2999.   iCFGHLP_FPMEMOFILEBLOCKSIZE= (CFGHLP_BASE +133);
  3000.   iCFGHLP_CFGSYSTEMDB       = (CFGHLP_BASE +134);
  3001.   iCFGHLP_OBJECTMODE        = (CFGHLP_BASE +135); 
  3002.  
  3003. {============================================================================}
  3004. {                            Error Categories                                }
  3005. {============================================================================}
  3006.  
  3007. function ErrCat(rslt: Word): Word;
  3008. function ErrCode(rslt: Word): Word;
  3009.  
  3010. const
  3011.   ERRCAT_NONE                   = 0;      {  0   No error }
  3012.   ERRCAT_SYSTEM                 = $21;    {  33  System related (Fatal Error) }
  3013.   ERRCAT_NOTFOUND               = $22;    {  34  Object of interest Not Found }
  3014.   ERRCAT_DATACORRUPT            = $23;    {  35  Physical Data Corruption }
  3015.   ERRCAT_IO                     = $24;    {  36  I/O related error }
  3016.   ERRCAT_LIMIT                  = $25;    {  37  Resource or Limit error }
  3017.   ERRCAT_INTEGRITY              = $26;    {  38  Integrity Violation }
  3018.   ERRCAT_INVALIDREQ             = $27;    {  39  Invalid Request }
  3019.   ERRCAT_LOCKCONFLICT           = $28;    {  40  Locking/Contention related }
  3020.   ERRCAT_SECURITY               = $29;    {  41  Access Violation - Security related }
  3021.   ERRCAT_INVALIDCONTEXT         = $2A;    {  42  Invalid context }
  3022.   ERRCAT_OS                     = $2B;    {  43  Os Error not handled by Idapi }
  3023.   ERRCAT_NETWORK                = $2C;    {  44  Network related }
  3024.   ERRCAT_OPTPARAM               = $2D;    {  45  Optional parameter related }
  3025.   ERRCAT_QUERY                  = $2E;    {  46  Query related }
  3026.   ERRCAT_VERSION                = $2F;    {  47  Version Mismatch Category }
  3027.   ERRCAT_CAPABILITY             = $30;    {  48  Capability not supported }
  3028.   ERRCAT_CONFIG                 = $31;    {  49  System configuration error }
  3029.   ERRCAT_WARNING                = $32;    {  50 }
  3030.   ERRCAT_OTHER                  = $33;    {  51  Miscellaneous }
  3031.   ERRCAT_COMPATIBILITY          = $34;    {  52  Compatibility related }
  3032.   ERRCAT_REPOSITORY             = $35;    {  53  Data Repository related }
  3033.  
  3034.   ERRCAT_DRIVER                 = $3E;    {  62  Driver related }
  3035.   ERRCAT_RC                     = $3F;    {  63  Internal }
  3036.  
  3037.  
  3038.   ERRBASE_NONE                  = 0;      { No error }
  3039.   ERRBASE_SYSTEM                = $2100;  { System related (Fatal Error) }
  3040.   ERRBASE_NOTFOUND              = $2200;  { Object of interest Not Found }
  3041.   ERRBASE_DATACORRUPT           = $2300;  { Physical Data Corruption }
  3042.   ERRBASE_IO                    = $2400;  { I/O related error }
  3043.   ERRBASE_LIMIT                 = $2500;  { Resource or Limit error }
  3044.   ERRBASE_INTEGRITY             = $2600;  { Integrity Violation }
  3045.   ERRBASE_INVALIDREQ            = $2700;  { Invalid Request }
  3046.   ERRBASE_LOCKCONFLICT          = $2800;  { Locking/Contention related }
  3047.   ERRBASE_SEC                   = $2900;  { Access Violation - Security related }
  3048.   ERRBASE_IC                    = $2A00;  { Invalid context }
  3049.   ERRBASE_OS                    = $2B00;  { Os Error not handled by Idapi }
  3050.   ERRBASE_NETWORK               = $2C00;  { Network related }
  3051.   ERRBASE_OPTPARAM              = $2D00;  { Optional Parameter related }
  3052.   ERRBASE_QUERY                 = $2E00;  { Query related }
  3053.   ERRBASE_VERSION               = $2F00;  { Version Mismatch Category }
  3054.   ERRBASE_CAPABILITY            = $3000;  { Capability not supported }
  3055.   ERRBASE_CONFIG                = $3100;  { System configuration error }
  3056.   ERRBASE_WARNING               = $3200;
  3057.   ERRBASE_OTHER                 = $3300;  { Miscellaneous }
  3058.   ERRBASE_COMPATIBILITY         = $3400;  { Compatibility related }
  3059.   ERRBASE_REPOSITORY            = $3500;  { Data Repository related }
  3060.  
  3061.   ERRBASE_DRIVER                = $3E00;  { Driver related }
  3062.   ERRBASE_RC                    = $3F00;  { Internal }
  3063.  
  3064.  
  3065. {=============================================================================}
  3066. {                           Error Codes By Category                           }
  3067. {=============================================================================}
  3068.  
  3069. { ERRCAT_NONE                  (0) }
  3070. { ===========                      }
  3071.  
  3072.   ERRCODE_NONE                  = 0;
  3073.  
  3074.   DBIERR_NONE                   = (ERRBASE_NONE + ERRCODE_NONE);
  3075.  
  3076. {  ERRCAT_SYSTEM }
  3077. {  ============= }
  3078.  
  3079.   ERRCODE_SYSFILEOPEN           = 1;      { Cannot open a system file }
  3080.   ERRCODE_SYSFILEIO             = 2;      { I/O error on a system file }
  3081.   ERRCODE_SYSCORRUPT            = 3;      { Data structure corruption }
  3082.   ERRCODE_NOCONFIGFILE          = 4;      { Cannot find config file }
  3083.   ERRCODE_CFGCANNOTWRITE        = 5;      { Cannot write config file (READONLY) }
  3084.   ERRCODE_CFGMULTIFILE          = 6;      { Initializing with different ini file }
  3085.   ERRCODE_REENTERED             = 7;      { System has been illegally re-entered }
  3086.   ERRCODE_CANTFINDIDAPI         = 8;      { Cannot locate IDAPIxx.DLL }
  3087.   ERRCODE_CANTLOADIDAPI         = 9;      { Cannot load IDAPIxx.DLL }
  3088.   ERRCODE_CANTLOADLIBRARY       = 10;     { Cannot load a service DLL }
  3089.   ERRCODE_TEMPFILEERR           = 11;     { Cannot create or open temporary file }
  3090.   ERRCODE_MULTIPLEIDAPI         = 12;     { Trying to load multiple IDAPIxx.DLL }
  3091.   ERRCODE_SHAREDMEMCONFLICT     = 13;     { Shared memory conflict. }
  3092.  
  3093.   DBIERR_SYSFILEOPEN            = (ERRBASE_SYSTEM + ERRCODE_SYSFILEOPEN);
  3094.   DBIERR_SYSFILEIO              = (ERRBASE_SYSTEM + ERRCODE_SYSFILEIO);
  3095.   DBIERR_SYSCORRUPT             = (ERRBASE_SYSTEM + ERRCODE_SYSCORRUPT);
  3096.   DBIERR_NOCONFIGFILE           = (ERRBASE_SYSTEM + ERRCODE_NOCONFIGFILE);
  3097.   DBIERR_CFGCANNOTWRITE         = (ERRBASE_SYSTEM + ERRCODE_CFGCANNOTWRITE);
  3098.   DBIERR_CFGMULTIFILE           = (ERRBASE_SYSTEM + ERRCODE_CFGMULTIFILE);
  3099.   DBIERR_REENTERED              = (ERRBASE_SYSTEM + ERRCODE_REENTERED);
  3100.   DBIERR_CANTFINDIDAPI          = (ERRBASE_SYSTEM + ERRCODE_CANTFINDIDAPI);
  3101.   DBIERR_CANTLOADIDAPI          = (ERRBASE_SYSTEM + ERRCODE_CANTLOADIDAPI);
  3102.   DBIERR_CANTLOADLIBRARY        = (ERRBASE_SYSTEM + ERRCODE_CANTLOADLIBRARY);
  3103.   DBIERR_TEMPFILEERR            = (ERRBASE_SYSTEM + ERRCODE_TEMPFILEERR);
  3104.   DBIERR_MULTIPLEIDAPI          = (ERRBASE_SYSTEM + ERRCODE_MULTIPLEIDAPI);
  3105.   DBIERR_SHAREDMEMCONFLICT      = (ERRBASE_SYSTEM + ERRCODE_SHAREDMEMCONFLICT);
  3106.  
  3107.   DBIERR_CANTFINDODAPI = DBIERR_CANTFINDIDAPI;
  3108.   DBIERR_CANTLOADODAPI = DBIERR_CANTLOADIDAPI;
  3109.  
  3110. {  ERRCAT_NOTFOUND }
  3111. {  =============== }
  3112.  
  3113.   ERRCODE_BOF                   = 1;      { Beginning of Virtual table }
  3114.   ERRCODE_EOF                   = 2;      { End of Virtual table }
  3115.   ERRCODE_RECMOVED              = 3;      { Fly-away }
  3116.   ERRCODE_KEYORRECDELETED       = 4;      { Record Deleted/Key Modified }
  3117.   ERRCODE_NOCURRREC             = 5;      { No current record }
  3118.   ERRCODE_RECNOTFOUND           = 6;      { Record was not found }
  3119.   ERRCODE_ENDOFBLOB             = 7;      { End of Blob reached }
  3120.   ERRCODE_OBJNOTFOUND           = 8;      { Generic Not found }
  3121.   ERRCODE_FMLMEMBERNOTFOUND     = 9;      { Family member not found }
  3122.   ERRCODE_BLOBFILEMISSING       = 10;     { 0x0a Blob file for table is missing }
  3123.   ERRCODE_LDNOTFOUND            = 11;     { 0x0b Language driver not found }
  3124.  
  3125.   DBIERR_BOF                    = (ERRBASE_NOTFOUND + ERRCODE_BOF);
  3126.   DBIERR_EOF                    = (ERRBASE_NOTFOUND + ERRCODE_EOF);
  3127.   DBIERR_RECMOVED               = (ERRBASE_NOTFOUND + ERRCODE_RECMOVED);
  3128.   DBIERR_RECDELETED             = (ERRBASE_NOTFOUND + ERRCODE_KEYORRECDELETED);
  3129.   DBIERR_KEYORRECDELETED        = (ERRBASE_NOTFOUND + ERRCODE_KEYORRECDELETED);
  3130.   DBIERR_NOCURRREC              = (ERRBASE_NOTFOUND + ERRCODE_NOCURRREC);
  3131.   DBIERR_RECNOTFOUND            = (ERRBASE_NOTFOUND + ERRCODE_RECNOTFOUND);
  3132.   DBIERR_ENDOFBLOB              = (ERRBASE_NOTFOUND + ERRCODE_ENDOFBLOB);
  3133.   DBIERR_OBJNOTFOUND            = (ERRBASE_NOTFOUND + ERRCODE_OBJNOTFOUND);
  3134.   DBIERR_FMLMEMBERNOTFOUND      = (ERRBASE_NOTFOUND + ERRCODE_FMLMEMBERNOTFOUND);
  3135.   DBIERR_BLOBFILEMISSING        = (ERRBASE_NOTFOUND + ERRCODE_BLOBFILEMISSING);
  3136.   DBIERR_LDNOTFOUND             = (ERRBASE_NOTFOUND + ERRCODE_LDNOTFOUND);
  3137.  
  3138. { ERRCAT_DATACORRUPT }
  3139. { ================== }
  3140.  
  3141.   ERRCODE_HEADERCORRUPT         = 1;      { Corrupt Header }
  3142.   ERRCODE_FILECORRUPT           = 2;      { File corrupt - other than header }
  3143.   ERRCODE_MEMOCORRUPT           = 3;      { Memo file corrupted }
  3144.   ERRCODE_BMPCORRUPT            = 4;      { BitMap is corrupt (Internal error) }
  3145.   ERRCODE_INDEXCORRUPT          = 5;      { Index is corrupt }
  3146.   ERRCODE_CORRUPTLOCKFILE       = 6;      { Corrupt lock file }
  3147.   ERRCODE_FAMFILEINVALID        = 7;      { Corrupt family file }
  3148.   ERRCODE_VALFILECORRUPT        = 8;      { Val file is missing or corrupt }
  3149.   ERRCODE_FOREIGNINDEX          = 9;      { Index is in a foreign format - import first }
  3150.  
  3151.  
  3152.   DBIERR_HEADERCORRUPT          = (ERRBASE_DATACORRUPT + ERRCODE_HEADERCORRUPT);
  3153.   DBIERR_FILECORRUPT            = (ERRBASE_DATACORRUPT + ERRCODE_FILECORRUPT);
  3154.   DBIERR_MEMOCORRUPT            = (ERRBASE_DATACORRUPT + ERRCODE_MEMOCORRUPT);
  3155.   DBIERR_BMPCORRUPT             = (ERRBASE_DATACORRUPT + ERRCODE_BMPCORRUPT);
  3156.   DBIERR_INDEXCORRUPT           = (ERRBASE_DATACORRUPT + ERRCODE_INDEXCORRUPT);
  3157.   DBIERR_CORRUPTLOCKFILE        = (ERRBASE_DATACORRUPT + ERRCODE_CORRUPTLOCKFILE);
  3158.   DBIERR_FAMFILEINVALID         = (ERRBASE_DATACORRUPT + ERRCODE_FAMFILEINVALID);
  3159.   DBIERR_VALFILECORRUPT         = (ERRBASE_DATACORRUPT + ERRCODE_VALFILECORRUPT);
  3160.   DBIERR_FOREIGNINDEX           = (ERRBASE_DATACORRUPT + ERRCODE_FOREIGNINDEX);
  3161.  
  3162.  
  3163. { ERRCAT_IO }
  3164. { ========= }
  3165.  
  3166.   ERRCODE_READERR               = 1;      { Read failure (not expected) }
  3167.   ERRCODE_WRITEERR              = 2;      { Write failure (not expected) }
  3168.   ERRCODE_DIRNOACCESS           = 3;      { No access to dir }
  3169.   ERRCODE_FILEDELETEFAIL        = 4;      { File delete failed }
  3170.   ERRCODE_FILENOACCESS          = 5;      { No access to file }
  3171.   ERRCODE_ACCESSDISABLED        = 6;      { Access to table disabled (previous error) }
  3172.  
  3173.   DBIERR_READERR                = (ERRBASE_IO + ERRCODE_READERR);
  3174.   DBIERR_WRITEERR               = (ERRBASE_IO + ERRCODE_WRITEERR);
  3175.   DBIERR_DIRNOACCESS            = (ERRBASE_IO + ERRCODE_DIRNOACCESS);
  3176.   DBIERR_FILEDELETEFAIL         = (ERRBASE_IO + ERRCODE_FILEDELETEFAIL);
  3177.   DBIERR_FILENOACCESS           = (ERRBASE_IO + ERRCODE_FILENOACCESS);
  3178.   DBIERR_ACCESSDISABLED         = (ERRBASE_IO + ERRCODE_ACCESSDISABLED);
  3179.  
  3180. { ERRCAT_LIMIT }
  3181. { ============ }
  3182.  
  3183.   ERRCODE_NOMEMORY              = 1;      { Not enough Memory for this op }
  3184.   ERRCODE_NOFILEHANDLES         = 2;      { Not enough File handles }
  3185.   ERRCODE_NODISKSPACE           = 3;      { Not enough Disk space }
  3186.   ERRCODE_NOTEMPTBLSPACE        = 4;      { Temporary Table resource limit }
  3187.   ERRCODE_RECTOOBIG             = 5;      { Too big a record size for table }
  3188.   ERRCODE_CURSORLIMIT           = 6;      { Too many open cursors }
  3189.   ERRCODE_TABLEFULL             = 7;      { Table is full }
  3190.   ERRCODE_WSSESLIMIT            = 8;      { Too many sessions from this WS }
  3191.   ERRCODE_SERNUMLIMIT           = 9;      { Serial number limit (paradox) }
  3192.   ERRCODE_INTERNALLIMIT         = 10;     { 0x0a Some internal limit (see context) }
  3193.   ERRCODE_OPENTBLLIMIT          = 11;     { 0x0b Too many open tables }
  3194.   ERRCODE_TBLCURSORLIMIT        = 12;     { 0x0c Too many cursors per table }
  3195.   ERRCODE_RECLOCKLIMIT          = 13;     { 0x0d Too many record locks on table }
  3196.   ERRCODE_CLIENTSLIMIT          = 14;     { 0x0e Too many clients }
  3197.   ERRCODE_INDEXLIMIT            = 15;     { 0x0f Too many indexes (also in Table Create) }
  3198.   ERRCODE_SESSIONSLIMIT         = 16;     { 0x10 Too many sessions }
  3199.   ERRCODE_DBLIMIT               = 17;     { 0x11 Too many databases }
  3200.   ERRCODE_PASSWORDLIMIT         = 18;     { 0x12 Too many passwords }
  3201.   ERRCODE_DRIVERLIMIT           = 19;     { 0x13 Too many active drivers }
  3202.   ERRCODE_FLDLIMIT              = 20;     { 0x14 Too many Fields in Table Create }
  3203.   ERRCODE_TBLLOCKLIMIT          = 21;     { 0x15 Too many table locks }
  3204.   ERRCODE_OPENBLOBLIMIT         = 22;     { 0x16 Too many open blobs }
  3205.   ERRCODE_LOCKFILELIMIT         = 23;     { 0x17 Lock file has grown too big }
  3206.   ERRCODE_OPENQRYLIMIT          = 24;     { 0x18 Too many open queries }
  3207.   ERRCODE_THREADLIMIT           = 25;     { 0x19 Too many threads for client }
  3208.   ERRCODE_BLOBLIMIT             = 26;     { 0x1a Too many blobs }
  3209.   ERRCODE_PDX50NAMELIMIT        = 27;     { 0x1b Pathname is too long for a Paradox 5.0 or less table }
  3210.   ERRCODE_ROWFETCHLIMIT         = 28;     { 0x1c Row fetch limit }
  3211.   ERRCODE_LONGNAMENOTALLOWED    = 29;     { 0x1d Long name is not allowed for this tableversion }
  3212.   ERRCODE_NOSHAREDMEMORY        = 30;     { 0x1e Not enough shared Memory for this operation }
  3213.  
  3214.   DBIERR_NOMEMORY               = (ERRBASE_LIMIT + ERRCODE_NOMEMORY);
  3215.   DBIERR_NOFILEHANDLES          = (ERRBASE_LIMIT + ERRCODE_NOFILEHANDLES);
  3216.   DBIERR_NODISKSPACE            = (ERRBASE_LIMIT + ERRCODE_NODISKSPACE);
  3217.   DBIERR_NOTEMPTBLSPACE         = (ERRBASE_LIMIT + ERRCODE_NOTEMPTBLSPACE);
  3218.   DBIERR_RECTOOBIG              = (ERRBASE_LIMIT + ERRCODE_RECTOOBIG);
  3219.   DBIERR_CURSORLIMIT            = (ERRBASE_LIMIT + ERRCODE_CURSORLIMIT);
  3220.   DBIERR_TABLEFULL              = (ERRBASE_LIMIT + ERRCODE_TABLEFULL);
  3221.   DBIERR_WSSESLIMIT             = (ERRBASE_LIMIT + ERRCODE_WSSESLIMIT);
  3222.   DBIERR_SERNUMLIMIT            = (ERRBASE_LIMIT + ERRCODE_SERNUMLIMIT);
  3223.   DBIERR_INTERNALLIMIT          = (ERRBASE_LIMIT + ERRCODE_INTERNALLIMIT);
  3224.   DBIERR_OPENTBLLIMIT           = (ERRBASE_LIMIT + ERRCODE_OPENTBLLIMIT);
  3225.   DBIERR_TBLCURSORLIMIT         = (ERRBASE_LIMIT + ERRCODE_TBLCURSORLIMIT);
  3226.   DBIERR_RECLOCKLIMIT           = (ERRBASE_LIMIT + ERRCODE_RECLOCKLIMIT);
  3227.   DBIERR_CLIENTSLIMIT           = (ERRBASE_LIMIT + ERRCODE_CLIENTSLIMIT);
  3228.   DBIERR_INDEXLIMIT             = (ERRBASE_LIMIT + ERRCODE_INDEXLIMIT);
  3229.   DBIERR_SESSIONSLIMIT          = (ERRBASE_LIMIT + ERRCODE_SESSIONSLIMIT);
  3230.   DBIERR_DBLIMIT                = (ERRBASE_LIMIT + ERRCODE_DBLIMIT);
  3231.   DBIERR_PASSWORDLIMIT          = (ERRBASE_LIMIT + ERRCODE_PASSWORDLIMIT);
  3232.   DBIERR_DRIVERLIMIT            = (ERRBASE_LIMIT + ERRCODE_DRIVERLIMIT);
  3233.   DBIERR_FLDLIMIT               = (ERRBASE_LIMIT + ERRCODE_FLDLIMIT);
  3234.   DBIERR_TBLLOCKLIMIT           = (ERRBASE_LIMIT + ERRCODE_TBLLOCKLIMIT);
  3235.   DBIERR_OPENBLOBLIMIT          = (ERRBASE_LIMIT + ERRCODE_OPENBLOBLIMIT);
  3236.   DBIERR_LOCKFILELIMIT          = (ERRBASE_LIMIT + ERRCODE_LOCKFILELIMIT);
  3237.   DBIERR_OPENQRYLIMIT           = (ERRBASE_LIMIT + ERRCODE_OPENQRYLIMIT);
  3238.   DBIERR_THREADLIMIT            = (ERRBASE_LIMIT + ERRCODE_THREADLIMIT);
  3239.   DBIERR_BLOBLIMIT              = (ERRBASE_LIMIT + ERRCODE_BLOBLIMIT);
  3240.   DBIERR_PDX50NAMELIMIT         = (ERRBASE_LIMIT + ERRCODE_PDX50NAMELIMIT);
  3241.   DBIERR_ROWFETCHLIMIT          = (ERRBASE_LIMIT + ERRCODE_ROWFETCHLIMIT);
  3242.   DBIERR_LONGNAMENOTALLOWED     = (ERRBASE_LIMIT + ERRCODE_LONGNAMENOTALLOWED);
  3243.   DBIERR_NOSHAREDMEMORY         = (ERRBASE_LIMIT + ERRCODE_NOSHAREDMEMORY);
  3244.  
  3245.  
  3246. { ERRCAT_INTEGRITY }
  3247. { ================ }
  3248.  
  3249.   ERRCODE_KEYVIOL               = 1;      { Key violation }
  3250.   ERRCODE_MINVALERR             = 2;      { Min val check failed }
  3251.   ERRCODE_MAXVALERR             = 3;      { Max val check failed }
  3252.   ERRCODE_REQDERR               = 4;      { Field value required }
  3253.   ERRCODE_FORIEGNKEYERR         = 5;      { Master record missing }
  3254.   ERRCODE_DETAILRECORDSEXIST    = 6;      { Cannot MODIFY or DELETE this Master record }
  3255.   ERRCODE_MASTERTBLLEVEL        = 7;      { Master Table Level is incorrect }
  3256.   ERRCODE_LOOKUPTABLEERR        = 8;      { Field value out of lookup tbl range }
  3257.   ERRCODE_LOOKUPTBLOPENERR      = 9;      { Lookup Table Open failed }
  3258.   ERRCODE_DETAILTBLOPENERR      = 10;     { 0x0a Detail Table Open failed }
  3259.   ERRCODE_MASTERTBLOPENERR      = 11;     { 0x0b Master Table Open failed }
  3260.   ERRCODE_FIELDISBLANK          = 12;     { 0x0c Field is blank }
  3261.  
  3262.   ERRCODE_MASTEREXISTS          = 13;     { 0x0d Master Table exists }
  3263.   ERRCODE_MASTERTBLOPEN         = 14;     { 0x0e Master Table is open }
  3264.  
  3265.   ERRCODE_DETAILTABLESEXIST     = 15;     { 0x0f Detail Tables exist ( cannot delete, rename ... ) }
  3266.   ERRCODE_DETAILRECEXISTEMPTY   = 16;     { 0x10 Cannot empty because details exist }
  3267.   ERRCODE_MASTERREFERENCEERR    = 17;     { 0x11 Cannot modify while adding self referencing Referential Integrity }
  3268.   ERRCODE_DETAILTBLOPEN         = 18;     { 0x12 Detail Table is opened }
  3269.   ERRCODE_DEPENDENTSMUSTBEEMPTY = 19;     { 0x13 Cannot make a master a detail of another table if its details are not empty. }
  3270.   ERRCODE_RINTREQINDEX          = 20;     { 0x14 Ref. integrity fields must be indexed }
  3271.   ERRCODE_LINKEDTBLPROTECTED    = 21;     { 0x15 Master Table is protected ( requires password to open) }
  3272.   ERRCODE_FIELDMULTILINKED      = 22;     { 0x16 Field has more than one master }
  3273.   ERRCODE_EXPRVALERR            = 23;     { 0x17 Expr val check failed }
  3274.  
  3275.   DBIERR_KEYVIOL                = (ERRBASE_INTEGRITY + ERRCODE_KEYVIOL);
  3276.   DBIERR_MINVALERR              = (ERRBASE_INTEGRITY + ERRCODE_MINVALERR);
  3277.   DBIERR_MAXVALERR              = (ERRBASE_INTEGRITY + ERRCODE_MAXVALERR);
  3278.   DBIERR_REQDERR                = (ERRBASE_INTEGRITY + ERRCODE_REQDERR);
  3279.   DBIERR_FORIEGNKEYERR          = (ERRBASE_INTEGRITY + ERRCODE_FORIEGNKEYERR);
  3280.   DBIERR_DETAILRECORDSEXIST     = (ERRBASE_INTEGRITY + ERRCODE_DETAILRECORDSEXIST);
  3281.   DBIERR_MASTERTBLLEVEL         = (ERRBASE_INTEGRITY + ERRCODE_MASTERTBLLEVEL);
  3282.   DBIERR_LOOKUPTABLEERR         = (ERRBASE_INTEGRITY + ERRCODE_LOOKUPTABLEERR);
  3283.   DBIERR_LOOKUPTBLOPENERR       = (ERRBASE_INTEGRITY + ERRCODE_LOOKUPTBLOPENERR);
  3284.   DBIERR_DETAILTBLOPENERR       = (ERRBASE_INTEGRITY + ERRCODE_DETAILTBLOPENERR);
  3285.   DBIERR_MASTERTBLOPENERR       = (ERRBASE_INTEGRITY + ERRCODE_MASTERTBLOPENERR);
  3286.   DBIERR_FIELDISBLANK           = (ERRBASE_INTEGRITY + ERRCODE_FIELDISBLANK);
  3287.   DBIERR_MASTEREXISTS           = (ERRBASE_INTEGRITY + ERRCODE_MASTEREXISTS);
  3288.   DBIERR_MASTERTBLOPEN          = (ERRBASE_INTEGRITY + ERRCODE_MASTERTBLOPEN);
  3289.   DBIERR_DETAILTABLESEXIST      = (ERRBASE_INTEGRITY + ERRCODE_DETAILTABLESEXIST);
  3290.   DBIERR_DETAILRECEXISTEMPTY    = (ERRBASE_INTEGRITY + ERRCODE_DETAILRECEXISTEMPTY);
  3291.   DBIERR_MASTERREFERENCEERR     = (ERRBASE_INTEGRITY + ERRCODE_MASTERREFERENCEERR);
  3292.   DBIERR_DETAILTBLOPEN          = (ERRBASE_INTEGRITY + ERRCODE_DETAILTBLOPEN);
  3293.   DBIERR_DEPENDENTSMUSTBEEMPTY  = (ERRBASE_INTEGRITY + ERRCODE_DEPENDENTSMUSTBEEMPTY);
  3294.   DBIERR_RINTREQINDEX           = (ERRBASE_INTEGRITY + ERRCODE_RINTREQINDEX);
  3295.   DBIERR_LINKEDTBLPROTECTED     = (ERRBASE_INTEGRITY + ERRCODE_LINKEDTBLPROTECTED);
  3296.   DBIERR_FIELDMULTILINKED       = (ERRBASE_INTEGRITY + ERRCODE_FIELDMULTILINKED);
  3297.   DBIERR_EXPRVALERR             = (ERRBASE_INTEGRITY + ERRCODE_EXPRVALERR);
  3298.  
  3299.  
  3300. { ERRCAT_INVALIDREQ }
  3301. { ================= }
  3302.  
  3303.   ERRCODE_OUTOFRANGE            = 1;      { Number out of range (e.g field no) }
  3304.   ERRCODE_INVALIDPARAM          = 2;      { Generic invalid parameter }
  3305.   ERRCODE_INVALIDFILENAME       = 3;      { Invalid file name }
  3306.   ERRCODE_NOSUCHFILE            = 4;      { No such file }
  3307.   ERRCODE_INVALIDOPTION         = 5;      { Invalid option for a parameter }
  3308.   ERRCODE_INVALIDHNDL           = 6;      { Invalid handle to the function }
  3309.   ERRCODE_UNKNOWNTBLTYPE        = 7;      { Table type given not known }
  3310.   ERRCODE_UNKNOWNFILE           = 8;      { Dont know how to open file }
  3311.   ERRCODE_PRIMARYKEYREDEFINE    = 9;      { Cannot redefine primary key }
  3312.   ERRCODE_INVALIDRINTDESCNUM    = 10;     { 0x0a Cannot change this RINTDesc }
  3313.   ERRCODE_KEYFLDTYPEMISMATCH    = 11;     { 0x0b Foreign & Primary Key Mismatch }
  3314.   ERRCODE_INVALIDMODIFYREQUEST  = 12;     { 0x0c Invalid modify request }
  3315.   ERRCODE_NOSUCHINDEX           = 13;     { 0x0d Index does not exist }
  3316.   ERRCODE_INVALIDBLOBOFFSET     = 14;     { 0x0e Invalid Offset into the Blob }
  3317.   ERRCODE_INVALIDDESCNUM        = 15;     { 0x0f Invalid descriptor number }
  3318.   ERRCODE_INVALIDFLDTYPE        = 16;     { 0x10 Invalid field type }
  3319.   ERRCODE_INVALIDFLDDESC        = 17;     { 0x11 Invalid field descriptor }
  3320.   ERRCODE_INVALIDFLDXFORM       = 18;     { 0x12 Invalid field transform }
  3321.   ERRCODE_INVALIDRECSTRUCT      = 19;     { 0x13 Invalid record structure }
  3322.   ERRCODE_INVALIDDESC           = 20;     { 0x14 Generic: invalid descriptor }
  3323.   ERRCODE_INVALIDINDEXSTRUCT    = 21;     { 0x15 Invalid array of indexes descriptors }
  3324.   ERRCODE_INVALIDVCHKSTRUCT     = 22;     { 0x16 Invalid array of  val. check descriptors }
  3325.   ERRCODE_INVALIDRINTSTRUCT     = 23;     { 0x17 Invalid array of ref. integrity descriptors }
  3326.   ERRCODE_INVALIDRESTRTBLORDER  = 24;     { 0x18 Invalid ordering of tables during restructure }
  3327.   ERRCODE_NAMENOTUNIQUE         = 25;     { 0x19 Name not unique in this context }
  3328.   ERRCODE_INDEXNAMEREQUIRED     = 26;     { 0x1a Index name required }
  3329.   ERRCODE_INVALIDSESHANDLE      = 27;     { 0x1b Invalid ses handle }
  3330.   ERRCODE_INVALIDRESTROP        = 28;     { 0x1c Invalid restructure operation }
  3331.   ERRCODE_UNKNOWNDRIVER         = 29;     { 0x1d Driver not known to system }
  3332.   ERRCODE_UNKNOWNDB             = 30;     { 0x1e Unknown db }
  3333.   ERRCODE_INVALIDPASSWORD       = 31;     { 0x1f Invalid password given }
  3334.   ERRCODE_NOCALLBACK            = 32;     { 0x20 No callback function }
  3335.   ERRCODE_INVALIDCALLBACKBUFLEN = 33;     { 0x21 Invalid callback buffer length }
  3336.   ERRCODE_INVALIDDIR            = 34;     { 0x22 Invalid directory }
  3337.   ERRCODE_INVALIDXLATION        = 35;     { 0x23 Translate Error - Translate DID NOT happen }
  3338.   ERRCODE_DIFFERENTTABLES       = 36;     { 0x24 Cannot Set Cursor of one Table to another }
  3339.   ERRCODE_INVALIDBOOKMARK       = 37;     { 0x25 Bookmarks does not match table, etc. }
  3340.   ERRCODE_INVALIDINDEXNAME      = 38;     { 0x26 Index/Tag Name is invalid }
  3341.   ERRCODE_INVALIDIDXDESC        = 39;     { 0x27 Invalid index descriptor }
  3342.   ERRCODE_NOSUCHTABLE           = 40;     { 0x28 No such table }
  3343.   ERRCODE_USECOUNT              = 41;     { 0x29 Table has too many users }
  3344.   ERRCODE_INVALIDKEY            = 42;     { 0x2a Key does not pass filter condition }
  3345.   ERRCODE_INDEXEXISTS           = 43;     { 0x2b Index already exists }
  3346.   ERRCODE_INDEXOPEN             = 44;     { 0x2c Index is open }
  3347.   ERRCODE_INVALIDBLOBLEN        = 45;     { 0x2d Invalid Blob Length }
  3348.   ERRCODE_INVALIDBLOBHANDLE     = 46;     { 0x2e Invalid Blob handle (in record buffer) }
  3349.   ERRCODE_TABLEOPEN             = 47;     { 0x2f Table is open }
  3350.   ERRCODE_NEEDRESTRUCTURE       = 48;     { 0x30 Need to do (hard) restructure }
  3351.   ERRCODE_INVALIDMODE           = 49;     { 0x31 Invalid mode }
  3352.   ERRCODE_CANNOTCLOSE           = 50;     { 0x32 Cannot close index }
  3353.   ERRCODE_ACTIVEINDEX           = 51;     { 0x33 Index is being used to order tbl }
  3354.   ERRCODE_INVALIDUSRPASS        = 52;     { 0x34 Bad user name or password }
  3355.   ERRCODE_MULTILEVELCASCADE     = 53;     { 0x35 Multi level Cascade not supported }
  3356.   ERRCODE_INVALIDFIELDNAME      = 54;     { 0x36 Invalid field name }
  3357.   ERRCODE_INVALIDTABLENAME      = 55;     { 0x37 Invalid table name }
  3358.   ERRCODE_INVALIDLINKEXPR       = 56;     { 0x38 Invalid linked cursor expression }
  3359.   ERRCODE_NAMERESERVED          = 57;     { 0x39 Name is reserved }
  3360.   ERRCODE_INVALIDFILEEXTN       = 58;     { 0x3a Invalid file extention }
  3361.   ERRCODE_INVALIDLANGDRV        = 59;     { 0x3b Invalid language driver }
  3362.   ERRCODE_ALIASNOTOPEN          = 60;     { 0x3c Requested alias in not open }
  3363.   ERRCODE_INCOMPATRECSTRUCTS    = 61;     { 0x3d Incompatible record structures }
  3364.   ERRCODE_RESERVEDDOSNAME       = 62;     { 0x3e Reserved dos name }
  3365.   ERRCODE_DESTMUSTBEINDEXED     = 63;     { 0x3f Destination must be indexed }
  3366.   ERRCODE_INVALIDINDEXTYPE      = 64;     { 0x40 Invalid index type }
  3367.   ERRCODE_LANGDRVMISMATCH       = 65;     { 0x41 Language driver of table and index do not match }
  3368.   ERRCODE_NOSUCHFILTER          = 66;     { 0x42 Filter handle is invalid }
  3369.   ERRCODE_INVALIDFILTER         = 67;     { 0x43 Invalid filter }
  3370.  
  3371.   ERRCODE_INVALIDTABLECREATE    = 68;     { 0x44 Bad table create request (exact prob unknown) }
  3372.   ERRCODE_INVALIDTABLEDELETE    = 69;     { 0x45 Bad table delete request (exact prob unknown) }
  3373.   ERRCODE_INVALIDINDEXCREATE    = 70;     { 0x46 Bad index create request (exact prob unknown) }
  3374.   ERRCODE_INVALIDINDEXDELETE    = 71;     { 0x47 Bad index delete request (exact prob unknown) }
  3375.   ERRCODE_INVALIDTABLE          = 72;     { 0x48 Invalid table name specified }
  3376.   ERRCODE_MULTIRESULTS          = 73;     { 0X49 Multi results }
  3377.   ERRCODE_INVALIDTIME           = 74;     { 0X4A Multi results }
  3378.   ERRCODE_INVALIDDATE           = 75;     { 0X4B Multi results }
  3379.   ERRCODE_INVALIDTIMESTAMP      = 76;     { 0X4C Multi results }
  3380.   ERRCODE_DIFFERENTPATH         = 77;     { 0X4d Tables in different paths }
  3381.   ERRCODE_MISMATCHARGS          = 78;     { 0x4e MisMatch in the # of arguments }
  3382.   ERRCODE_FUNCTIONNOTFOUND      = 79;     { 0x4f Loaderlib cant find a func in the DLL (bad version?) }
  3383.   ERRCODE_MUSTUSEBASEORDER      = 80;     { 0x50 Must use baseorder for this operation }
  3384.   ERRCODE_INVALIDPROCEDURENAME  = 81;     { 0x51 Invalid procedure name }
  3385.   ERRCODE_INVALIDFLDMAP         = 82;     { 0x52 invalid field map }
  3386.  
  3387.  
  3388.   DBIERR_OUTOFRANGE             = (ERRBASE_INVALIDREQ + ERRCODE_OUTOFRANGE);
  3389.   DBIERR_INVALIDPARAM           = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDPARAM);
  3390.   DBIERR_INVALIDFILENAME        = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFILENAME);
  3391.   DBIERR_NOSUCHFILE             = (ERRBASE_INVALIDREQ + ERRCODE_NOSUCHFILE);
  3392.   DBIERR_INVALIDOPTION          = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDOPTION);
  3393.   DBIERR_INVALIDHNDL            = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDHNDL);
  3394.   DBIERR_UNKNOWNTBLTYPE         = (ERRBASE_INVALIDREQ + ERRCODE_UNKNOWNTBLTYPE);
  3395.   DBIERR_UNKNOWNFILE            = (ERRBASE_INVALIDREQ + ERRCODE_UNKNOWNFILE);
  3396.   DBIERR_PRIMARYKEYREDEFINE     = (ERRBASE_INVALIDREQ + ERRCODE_PRIMARYKEYREDEFINE);
  3397.   DBIERR_INVALIDRINTDESCNUM     = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDRINTDESCNUM);
  3398.   DBIERR_KEYFLDTYPEMISMATCH     = (ERRBASE_INVALIDREQ + ERRCODE_KEYFLDTYPEMISMATCH);
  3399.   DBIERR_INVALIDMODIFYREQUEST   = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDMODIFYREQUEST);
  3400.   DBIERR_NOSUCHINDEX            = (ERRBASE_INVALIDREQ + ERRCODE_NOSUCHINDEX);
  3401.   DBIERR_INVALIDBLOBOFFSET      = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDBLOBOFFSET);
  3402.   DBIERR_INVALIDDESCNUM         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDDESCNUM);
  3403.   DBIERR_INVALIDFLDTYPE         = (ERRBASE_INVALIDREQ +  ERRCODE_INVALIDFLDTYPE);
  3404.   DBIERR_INVALIDFLDDESC         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFLDDESC);
  3405.   DBIERR_INVALIDFLDXFORM        = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFLDXFORM);
  3406.   DBIERR_INVALIDRECSTRUCT       = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDRECSTRUCT);
  3407.   DBIERR_INVALIDDESC            = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDDESC);
  3408.   DBIERR_INVALIDINDEXSTRUCT     = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDINDEXSTRUCT);
  3409.   DBIERR_INVALIDVCHKSTRUCT      = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDVCHKSTRUCT);
  3410.   DBIERR_INVALIDRINTSTRUCT      = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDRINTSTRUCT);
  3411.   DBIERR_INVALIDRESTRTBLORDER   = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDRESTRTBLORDER);
  3412.   DBIERR_NAMENOTUNIQUE          = (ERRBASE_INVALIDREQ + ERRCODE_NAMENOTUNIQUE);
  3413.   DBIERR_INDEXNAMEREQUIRED      = (ERRBASE_INVALIDREQ + ERRCODE_INDEXNAMEREQUIRED);
  3414.   DBIERR_INVALIDSESHANDLE       = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDSESHANDLE);
  3415.   DBIERR_INVALIDRESTROP         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDRESTROP);
  3416.   DBIERR_UNKNOWNDRIVER          = (ERRBASE_INVALIDREQ + ERRCODE_UNKNOWNDRIVER);
  3417.   DBIERR_UNKNOWNDB              = (ERRBASE_INVALIDREQ + ERRCODE_UNKNOWNDB);
  3418.   DBIERR_INVALIDPASSWORD        = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDPASSWORD);
  3419.   DBIERR_NOCALLBACK             = (ERRBASE_INVALIDREQ + ERRCODE_NOCALLBACK);
  3420.   DBIERR_INVALIDCALLBACKBUFLEN  = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDCALLBACKBUFLEN );
  3421.   DBIERR_INVALIDDIR             = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDDIR);
  3422.   DBIERR_INVALIDXLATION         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDXLATION);
  3423.   DBIERR_DIFFERENTTABLES        = (ERRBASE_INVALIDREQ + ERRCODE_DIFFERENTTABLES);
  3424.   DBIERR_INVALIDBOOKMARK        = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDBOOKMARK);
  3425.   DBIERR_INVALIDINDEXNAME       = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDINDEXNAME);
  3426.   DBIERR_INVALIDIDXDESC         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDIDXDESC);
  3427.   DBIERR_NOSUCHTABLE            = (ERRBASE_INVALIDREQ + ERRCODE_NOSUCHTABLE);
  3428.   DBIERR_USECOUNT               = (ERRBASE_INVALIDREQ + ERRCODE_USECOUNT);
  3429.   DBIERR_INVALIDKEY             = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDKEY);
  3430.   DBIERR_INDEXEXISTS            = (ERRBASE_INVALIDREQ + ERRCODE_INDEXEXISTS);
  3431.   DBIERR_INDEXOPEN              = (ERRBASE_INVALIDREQ + ERRCODE_INDEXOPEN);
  3432.   DBIERR_INVALIDBLOBLEN         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDBLOBLEN);
  3433.   DBIERR_INVALIDBLOBHANDLE      = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDBLOBHANDLE);
  3434.   DBIERR_TABLEOPEN              = (ERRBASE_INVALIDREQ + ERRCODE_TABLEOPEN);
  3435.   DBIERR_NEEDRESTRUCTURE        = (ERRBASE_INVALIDREQ + ERRCODE_NEEDRESTRUCTURE);
  3436.   DBIERR_INVALIDMODE            = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDMODE);
  3437.   DBIERR_CANNOTCLOSE            = (ERRBASE_INVALIDREQ + ERRCODE_CANNOTCLOSE);
  3438.   DBIERR_ACTIVEINDEX            = (ERRBASE_INVALIDREQ + ERRCODE_ACTIVEINDEX);
  3439.   DBIERR_INVALIDUSRPASS         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDUSRPASS);
  3440.   DBIERR_MULTILEVELCASCADE      = (ERRBASE_INVALIDREQ + ERRCODE_MULTILEVELCASCADE);
  3441.   DBIERR_INVALIDFIELDNAME       = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFIELDNAME);
  3442.   DBIERR_INVALIDTABLENAME       = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTABLENAME);
  3443.   DBIERR_INVALIDLINKEXPR        = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDLINKEXPR);
  3444.   DBIERR_NAMERESERVED           = (ERRBASE_INVALIDREQ + ERRCODE_NAMERESERVED);
  3445.   DBIERR_INVALIDFILEEXTN        = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFILEEXTN);
  3446.   DBIERR_INVALIDLANGDRV         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDLANGDRV);
  3447.   DBIERR_ALIASNOTOPEN           = (ERRBASE_INVALIDREQ + ERRCODE_ALIASNOTOPEN);
  3448.   DBIERR_INCOMPATRECSTRUCTS     = (ERRBASE_INVALIDREQ + ERRCODE_INCOMPATRECSTRUCTS);
  3449.   DBIERR_RESERVEDOSNAME         = (ERRBASE_INVALIDREQ + ERRCODE_RESERVEDDOSNAME);
  3450.   DBIERR_DESTMUSTBEINDEXED      = (ERRBASE_INVALIDREQ + ERRCODE_DESTMUSTBEINDEXED);
  3451.   DBIERR_INVALIDINDEXTYPE       = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDINDEXTYPE);
  3452.   DBIERR_LANGDRVMISMATCH        = (ERRBASE_INVALIDREQ + ERRCODE_LANGDRVMISMATCH);
  3453.   DBIERR_NOSUCHFILTER           = (ERRBASE_INVALIDREQ + ERRCODE_NOSUCHFILTER);
  3454.   DBIERR_INVALIDFILTER          = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFILTER);
  3455.   DBIERR_INVALIDTABLECREATE     = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTABLECREATE);
  3456.   DBIERR_INVALIDTABLEDELETE     = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTABLEDELETE);
  3457.   DBIERR_INVALIDINDEXCREATE     = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDINDEXCREATE);
  3458.   DBIERR_INVALIDINDEXDELETE     = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDINDEXDELETE);
  3459.   DBIERR_INVALIDTABLE           = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTABLE);
  3460.   DBIERR_MULTIRESULTS           = (ERRBASE_INVALIDREQ + ERRCODE_MULTIRESULTS);
  3461.   DBIERR_INVALIDTIME            = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTIME);
  3462.   DBIERR_INVALIDDATE            = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDDATE);
  3463.   DBIERR_INVALIDTIMESTAMP       = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTIMESTAMP);
  3464.   DBIERR_DIFFERENTPATH          = (ERRBASE_INVALIDREQ + ERRCODE_DIFFERENTPATH);
  3465.   DBIERR_MISMATCHARGS           = (ERRBASE_INVALIDREQ + ERRCODE_MISMATCHARGS);
  3466.   DBIERR_FUNCTIONNOTFOUND       = (ERRBASE_INVALIDREQ + ERRCODE_FUNCTIONNOTFOUND);
  3467.   DBIERR_MUSTUSEBASEORDER       = (ERRBASE_INVALIDREQ + ERRCODE_MUSTUSEBASEORDER);
  3468.   DBIERR_INVALIDPROCEDURENAME   = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDPROCEDURENAME);
  3469.   DBIERR_INVALIDFLDMAP          = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFLDMAP);
  3470.  
  3471. { ERRCAT_LOCKCONFLICT }
  3472. { =================== }
  3473.  
  3474.   ERRCODE_LOCKED                = 1;
  3475.   ERRCODE_UNLOCKFAILED          = 2;
  3476.   ERRCODE_FILEBUSY              = 3;
  3477.   ERRCODE_DIRBUSY               = 4;
  3478.   ERRCODE_FILELOCKED            = 5;
  3479.   ERRCODE_DIRLOCKED             = 6;
  3480.   ERRCODE_ALREADYLOCKED         = 7;
  3481.   ERRCODE_NOTLOCKED             = 8;
  3482.   ERRCODE_LOCKTIMEOUT           = 9;
  3483.   ERRCODE_GROUPLOCKED           = 10;     { 0x0a }
  3484.   ERRCODE_LOSTTBLLOCK           = 11;     { 0x0b }
  3485.   ERRCODE_LOSTEXCLACCESS        = 12;     { 0x0c }
  3486.   ERRCODE_NEEDEXCLACCESS        = 13;     { 0x0d }
  3487.   ERRCODE_RECGROUPCONFLICT      = 14;     { 0x0e }
  3488.   ERRCODE_DEADLOCK              = 15;
  3489.   ERRCODE_ACTIVETRAN            = 16;
  3490.   ERRCODE_NOACTIVETRAN          = 17;
  3491.   ERRCODE_RECLOCKFAILED         = 18;
  3492.   ERRCODE_OPTRECLOCKFAILED      = 19;
  3493.   ERRCODE_OPTRECLOCKRECDEL      = 20;
  3494.   ERRCODE_LOCKEDRECS            = 21;
  3495.   ERRCODE_NEEDWRITELOCK         = 22;
  3496.   ERRCODE_ENLISTFAILED          = 23; 
  3497.  
  3498.   DBIERR_LOCKED                 = (ERRBASE_LOCKCONFLICT + ERRCODE_LOCKED);
  3499.   DBIERR_UNLOCKFAILED           = (ERRBASE_LOCKCONFLICT + ERRCODE_UNLOCKFAILED);
  3500.   DBIERR_FILEBUSY               = (ERRBASE_LOCKCONFLICT + ERRCODE_FILEBUSY);
  3501.   DBIERR_DIRBUSY                = (ERRBASE_LOCKCONFLICT + ERRCODE_DIRBUSY);
  3502.   DBIERR_FILELOCKED             = (ERRBASE_LOCKCONFLICT + ERRCODE_FILELOCKED);
  3503.   DBIERR_DIRLOCKED              = (ERRBASE_LOCKCONFLICT + ERRCODE_DIRLOCKED);
  3504.   DBIERR_ALREADYLOCKED          = (ERRBASE_LOCKCONFLICT + ERRCODE_ALREADYLOCKED);
  3505.   DBIERR_NOTLOCKED              = (ERRBASE_LOCKCONFLICT + ERRCODE_NOTLOCKED);
  3506.   DBIERR_LOCKTIMEOUT            = (ERRBASE_LOCKCONFLICT + ERRCODE_LOCKTIMEOUT);
  3507.   DBIERR_GROUPLOCKED            = (ERRBASE_LOCKCONFLICT + ERRCODE_GROUPLOCKED);
  3508.   DBIERR_LOSTTBLLOCK            = (ERRBASE_LOCKCONFLICT + ERRCODE_LOSTTBLLOCK);
  3509.   DBIERR_LOSTEXCLACCESS         = (ERRBASE_LOCKCONFLICT + ERRCODE_LOSTEXCLACCESS);
  3510.   DBIERR_NEEDEXCLACCESS         = (ERRBASE_LOCKCONFLICT  + ERRCODE_NEEDEXCLACCESS);
  3511.   DBIERR_RECGROUPCONFLICT       = (ERRBASE_LOCKCONFLICT + ERRCODE_RECGROUPCONFLICT);
  3512.   DBIERR_DEADLOCK               = (ERRBASE_LOCKCONFLICT + ERRCODE_DEADLOCK);
  3513.   DBIERR_ACTIVETRAN             = (ERRBASE_LOCKCONFLICT + ERRCODE_ACTIVETRAN);
  3514.   DBIERR_NOACTIVETRAN           = (ERRBASE_LOCKCONFLICT + ERRCODE_NOACTIVETRAN);
  3515.   DBIERR_RECLOCKFAILED          = (ERRBASE_LOCKCONFLICT + ERRCODE_RECLOCKFAILED);
  3516.   DBIERR_OPTRECLOCKFAILED       = (ERRBASE_LOCKCONFLICT + ERRCODE_OPTRECLOCKFAILED);
  3517.   DBIERR_OPTRECLOCKRECDEL       = (ERRBASE_LOCKCONFLICT + ERRCODE_OPTRECLOCKRECDEL);
  3518.   DBIERR_ENLISTFAILED           = (ERRBASE_LOCKCONFLICT + ERRCODE_ENLISTFAILED); 
  3519.  
  3520. { ERRCAT_SECURITY }
  3521. { =============== }
  3522.  
  3523.   ERRCODE_NOTSUFFFIELDRIGHTS    = 1;      { Not sufficient field  rights for operation }
  3524.   ERRCODE_NOTSUFFTABLERIGHTS    = 2;      { Not sufficient table  rights for operation }
  3525.   ERRCODE_NOTSUFFFAMILYRIGHTS   = 3;      { Not sufficient family rights for operation }
  3526.   ERRCODE_READONLYDIR           = 4;      { Is a read-only directory }
  3527.   ERRCODE_READONLYDB            = 5;      { Database is read-only }
  3528.   ERRCODE_READONLYFLD           = 6;      { Trying to modify read-only field }
  3529.   ERRCODE_TBLENCRYPTED          = 7;      { Table is encrypted (dBASE only) }
  3530.   ERRCODE_NOTSUFFSQLRIGHTS      = 8;      { Not sufficient sql rights for operation }
  3531.  
  3532.  
  3533.   DBIERR_NOTSUFFFIELDRIGHTS     = (ERRBASE_SEC + ERRCODE_NOTSUFFFIELDRIGHTS);
  3534.   DBIERR_NOTSUFFTABLERIGHTS     = (ERRBASE_SEC + ERRCODE_NOTSUFFTABLERIGHTS);
  3535.   DBIERR_NOTSUFFFAMILYRIGHTS    = (ERRBASE_SEC + ERRCODE_NOTSUFFFAMILYRIGHTS);
  3536.   DBIERR_READONLYDIR            = (ERRBASE_SEC + ERRCODE_READONLYDIR);
  3537.   DBIERR_READONLYDB             = (ERRBASE_SEC + ERRCODE_READONLYDB);
  3538.   DBIERR_READONLYFLD            = (ERRBASE_SEC + ERRCODE_READONLYFLD);
  3539.   DBIERR_TBLENCRYPTED           = (ERRBASE_SEC + ERRCODE_TBLENCRYPTED);
  3540.   DBIERR_NOTSUFFSQLRIGHTS       = (ERRBASE_SEC + ERRCODE_NOTSUFFSQLRIGHTS);
  3541.  
  3542.  
  3543. { ERRCAT_INVALIDCONTEXT }
  3544. { ===================== }
  3545.  
  3546.   ERRCODE_NOTABLOB              = 1;      { Field is not a blob }
  3547.   ERRCODE_BLOBOPENED            = 2;      { Blob already opened }
  3548.   ERRCODE_BLOBNOTOPENED         = 3;      { Blob not opened }
  3549.   ERRCODE_NA                    = 4;      { Operation not applicable }
  3550.   ERRCODE_NOTINDEXED            = 5;      { Table is not indexed }
  3551.   ERRCODE_NOTINITIALIZED        = 6;      { Engine not initialized }
  3552.   ERRCODE_MULTIPLEINIT          = 7;      { Attempt to re-initialize engine }
  3553.   ERRCODE_NOTSAMESESSION        = 8;      { Attempt to mix objs from diff ses }
  3554.   ERRCODE_PDXDRIVERNOTACTIVE    = 9;      { Paradox driver not active }
  3555.   ERRCODE_DRIVERNOTLOADED       = 10;     { 0x0a Driver not loaded }
  3556.   ERRCODE_TABLEREADONLY         = 11;     { 0x0b Table is read only }
  3557.   ERRCODE_NOASSOCINDEX          = 12;     { 0x0c No index associated with the cursor }
  3558.   ERRCODE_HASOPENCURSORS        = 13;     { 0x0d Has open cursors }
  3559.   ERRCODE_NOTABLESUPPORT        = 14;     { 0x0e Op cannot be done on this table }
  3560.   ERRCODE_INDEXREADONLY         = 15;     { 0x0f Index is read only }
  3561.   ERRCODE_NOUNIQUERECS          = 16;     { 0x10 Records are not unique }
  3562.   ERRCODE_NOTCURSESSION         = 17;     { 0x11 Not the current/active session }
  3563.   ERRCODE_INVALIDKEYWORD        = 18;     { 0x12 Invalid use of keyword. }
  3564.   ERRCODE_CONNECTINUSE          = 19;     { 0x13 Connection in use }
  3565.   ERRCODE_CONNECTNOTSHARED      = 20;     { 0x14 Passthru SQL connection not share }
  3566.  
  3567.  
  3568.   DBIERR_NOTABLOB               = (ERRBASE_IC + ERRCODE_NOTABLOB);
  3569.   DBIERR_BLOBOPENED             = (ERRBASE_IC + ERRCODE_BLOBOPENED);
  3570.   DBIERR_BLOBNOTOPENED          = (ERRBASE_IC + ERRCODE_BLOBNOTOPENED);
  3571.   DBIERR_NA                     = (ERRBASE_IC + ERRCODE_NA);
  3572.   DBIERR_NOTINDEXED             = (ERRBASE_IC + ERRCODE_NOTINDEXED);
  3573.   DBIERR_NOTINITIALIZED         = (ERRBASE_IC + ERRCODE_NOTINITIALIZED);
  3574.   DBIERR_MULTIPLEINIT           = (ERRBASE_IC + ERRCODE_MULTIPLEINIT);
  3575.   DBIERR_NOTSAMESESSION         = (ERRBASE_IC + ERRCODE_NOTSAMESESSION);
  3576.   DBIERR_PDXDRIVERNOTACTIVE     = (ERRBASE_IC + ERRCODE_PDXDRIVERNOTACTIVE);
  3577.   DBIERR_DRIVERNOTLOADED        = (ERRBASE_IC + ERRCODE_DRIVERNOTLOADED);
  3578.   DBIERR_TABLEREADONLY          = (ERRBASE_IC + ERRCODE_TABLEREADONLY);
  3579.   DBIERR_NOASSOCINDEX           = (ERRBASE_IC + ERRCODE_NOASSOCINDEX);
  3580.   DBIERR_HASOPENCURSORS         = (ERRBASE_IC + ERRCODE_HASOPENCURSORS);
  3581.   DBIERR_NOTABLESUPPORT         = (ERRBASE_IC + ERRCODE_NOTABLESUPPORT);
  3582.   DBIERR_INDEXREADONLY          = (ERRBASE_IC + ERRCODE_INDEXREADONLY);
  3583.   DBIERR_NOUNIQUERECS           = (ERRBASE_IC + ERRCODE_NOUNIQUERECS);
  3584.   DBIERR_NOTCURSESSION          = (ERRBASE_IC + ERRCODE_NOTCURSESSION);
  3585.   DBIERR_INVALIDKEYWORD         = (ERRBASE_IC + ERRCODE_INVALIDKEYWORD);
  3586.   DBIERR_CONNECTINUSE           = (ERRBASE_IC + ERRCODE_CONNECTINUSE);
  3587.   DBIERR_CONNECTNOTSHARED       = (ERRBASE_IC + ERRCODE_CONNECTNOTSHARED);
  3588.  
  3589.  
  3590. { ERRCAT_OS }
  3591. { ========= }
  3592. { DOS extended errors: }
  3593.  
  3594.   ERRCODE_OSEINVFNC             = 1;      { Invalid function number }
  3595.   ERRCODE_OSENOENT              = 2;      { No such file or directory }
  3596.   ERRCODE_OSENOPATH             = 3;      { Path not found }
  3597.   ERRCODE_OSEMFILE              = 4;      { Too many open files }
  3598.   ERRCODE_OSEACCES              = 5;      { Permission denied }
  3599.   ERRCODE_OSEBADF               = 6;      { Bad file number }
  3600.   ERRCODE_OSECONTR              = 7;      { Memory blocks destroyed }
  3601.   ERRCODE_OSENOMEM              = 8;      { Not enough core }
  3602.   ERRCODE_OSEINVMEM             = 9;      { Invalid memory block address }
  3603.   ERRCODE_OSEINVENV             = 10;     { 0x0a Invalid environment }
  3604.   ERRCODE_OSEINVFMT             = 11;     { 0x0b Invalid format }
  3605.   ERRCODE_OSEINVACC             = 12;     { 0x0c Invalid access code }
  3606.   ERRCODE_OSEINVDAT             = 13;     { 0x0d Invalid data }
  3607.   ERRCODE_OSENODEV              = 15;     { 0x0f No such device }
  3608.   ERRCODE_OSECURDIR             = 16;     { 0x10 Attempt to remove curdir }
  3609.   ERRCODE_OSENOTSAM             = 17;     { 0x11 Not same device }
  3610.   ERRCODE_OSENMFILE             = 18;     { 0x12 No more files }
  3611.   ERRCODE_OSEINVAL              = 19;     { 0x13 Invalid argument }
  3612.   ERRCODE_OSE2BIG               = 20;     { 0x14 Arg list too long }
  3613.   ERRCODE_OSENOEXEC             = 21;     { 0x15 Exec format error }
  3614.   ERRCODE_OSEXDEV               = 22;     { 0x16 Cross-device link }
  3615.   ERRCODE_OSEDOM                = 33;     { 0x21 Math argument }
  3616.   ERRCODE_OSERANGE              = 34;     { 0x22 Result to large }
  3617.   ERRCODE_OSEEXIST              = 35;     { 0x23 File already exists }
  3618.   ERRCODE_OSUNKNOWN             = 39;     { 0x27 Unkown | illegal error from rtl }
  3619.  
  3620.   ERRCODE_OSSHAREVIOL           = 50;     { 0x32 Share viol, ext. err 0x20 }
  3621.   ERRCODE_OSLOCKVIOL            = 51;     { 0x33 Lock viol, ext. err 0x21 }
  3622.   ERRCODE_OSINT24FAIL           = 52;     { 0x34 INT24 called }
  3623.   ERRCODE_OSDRIVENOTREADY       = 53;     { 0x35 Drive not ready }
  3624.  
  3625.  
  3626.  
  3627. { OTHER Os errors: }
  3628. { 1. idapi errors  }
  3629. { 2. errors from non-dos systems ( i.e. NOVELL ) }
  3630.  
  3631.   ERRCODE_NOTEXACT              = 100;    { 0x64 Not exact read/write }
  3632.   ERRCODE_OSNETERR              = 101;    { 0x65 Generic network error }
  3633.   ERRCODE_OSUNKNOWNSRVERR       = 102;    { 0x66 Error from file server }
  3634.   ERRCODE_SERVERNOMEMORY        = 103;    { 0x67 Server out of memory }
  3635.   ERRCODE_OSALREADYLOCKED       = 104;    { 0x68 Record already locked (by you) }
  3636.   ERRCODE_OSNOTLOCKED           = 105;    { 0x69 Record not locked }
  3637.   ERRCODE_NOSERVERSW            = 106;    { 0x6a Server software not running the workstation/server }
  3638.  
  3639.  
  3640.   DBIERR_OSEINVFNC              = ( ERRBASE_OS + ERRCODE_OSEINVFNC );
  3641.   DBIERR_OSENOENT               = ( ERRBASE_OS + ERRCODE_OSENOENT );
  3642.   DBIERR_OSENOPATH              = ( ERRBASE_OS + ERRCODE_OSENOPATH );
  3643.   DBIERR_OSEMFILE               = ( ERRBASE_OS + ERRCODE_OSEMFILE );
  3644.   DBIERR_OSEACCES               = ( ERRBASE_OS + ERRCODE_OSEACCES );
  3645.   DBIERR_OSEBADF                = ( ERRBASE_OS + ERRCODE_OSEBADF );
  3646.   DBIERR_OSECONTR               = ( ERRBASE_OS + ERRCODE_OSECONTR );
  3647.   DBIERR_OSENOMEM               = ( ERRBASE_OS + ERRCODE_OSENOMEM );
  3648.   DBIERR_OSEINVMEM              = ( ERRBASE_OS + ERRCODE_OSEINVMEM );
  3649.   DBIERR_OSEINVENV              = ( ERRBASE_OS + ERRCODE_OSEINVENV );
  3650.   DBIERR_OSEINVFMT              = ( ERRBASE_OS + ERRCODE_OSEINVFMT );
  3651.   DBIERR_OSEINVACC              = ( ERRBASE_OS + ERRCODE_OSEINVACC );
  3652.   DBIERR_OSEINVDAT              = ( ERRBASE_OS + ERRCODE_OSEINVDAT );
  3653.   DBIERR_OSENODEV               = ( ERRBASE_OS + ERRCODE_OSENODEV );
  3654.   DBIERR_OSECURDIR              = ( ERRBASE_OS + ERRCODE_OSECURDIR );
  3655.   DBIERR_OSENOTSAM              = ( ERRBASE_OS + ERRCODE_OSENOTSAM );
  3656.   DBIERR_OSENMFILE              = ( ERRBASE_OS + ERRCODE_OSENMFILE );
  3657.   DBIERR_OSEINVAL               = ( ERRBASE_OS + ERRCODE_OSEINVAL );
  3658.   DBIERR_OSE2BIG                = ( ERRBASE_OS + ERRCODE_OSE2BIG );
  3659.   DBIERR_OSENOEXEC              = ( ERRBASE_OS + ERRCODE_OSENOEXEC );
  3660.   DBIERR_OSEXDEV                = ( ERRBASE_OS + ERRCODE_OSEXDEV );
  3661.   DBIERR_OSEDOM                 = ( ERRBASE_OS + ERRCODE_OSEDOM );
  3662.   DBIERR_OSERANGE               = ( ERRBASE_OS + ERRCODE_OSERANGE );
  3663.   DBIERR_OSEEXIST               = ( ERRBASE_OS + ERRCODE_OSEEXIST );
  3664.   DBIERR_OSUNKNOWN              = ( ERRBASE_OS + ERRCODE_OSUNKNOWN );
  3665.   DBIERR_OSSHAREVIOL            = ( ERRBASE_OS + ERRCODE_OSSHAREVIOL );
  3666.   DBIERR_OSLOCKVIOL             = ( ERRBASE_OS + ERRCODE_OSLOCKVIOL );
  3667.   DBIERR_OSNETERR               = ( ERRBASE_OS + ERRCODE_OSNETERR );
  3668.   DBIERR_OSINT24FAIL            = ( ERRBASE_OS + ERRCODE_OSINT24FAIL );
  3669.   DBIERR_OSDRIVENOTREADY        = ( ERRBASE_OS + ERRCODE_OSDRIVENOTREADY );
  3670.  
  3671.  
  3672.   DBIERR_NOTEXACT               = ( ERRBASE_OS + ERRCODE_NOTEXACT );
  3673.   DBIERR_OSUNKNOWNSRVERR        = ( ERRBASE_OS + ERRCODE_OSUNKNOWNSRVERR );
  3674.   DBIERR_SERVERNOMEMORY         = ( ERRBASE_OS + ERRCODE_SERVERNOMEMORY );
  3675.   DBIERR_OSALREADYLOCKED        = ( ERRBASE_OS + ERRCODE_OSALREADYLOCKED );
  3676.   DBIERR_OSNOTLOCKED            = ( ERRBASE_OS + ERRCODE_OSNOTLOCKED );
  3677.   DBIERR_NOSERVERSW             = ( ERRBASE_OS + ERRCODE_NOSERVERSW);
  3678.  
  3679. { ERRCAT_NETWORK }
  3680. { ============== }
  3681.  
  3682.   ERRCODE_NETINITERR            = 1;      { Net init failed }
  3683.   ERRCODE_NETUSERLIMIT          = 2;      { Net user limit exceeded }
  3684.   ERRCODE_NETFILEVERSION        = 3;      { Wrong net file version }
  3685.   ERRCODE_NETFILELOCKED         = 4;      { Not able to lock net file }
  3686.   ERRCODE_DIRNOTPRIVATE         = 5;
  3687.   ERRCODE_NETMULTIPLE           = 6;      { Multiple net files in use }
  3688.   ERRCODE_NETUNKNOWN            = 7;      { Unknown net error }
  3689.   ERRCODE_SHAREDFILE            = 8;      { Cannot access a shared file }
  3690.   ERRCODE_SHARENOTLOADED        = 9;      { Share not loaded }
  3691.   ERRCODE_NOTONANETWORK         = 10;     { 0x0a Not an Network }
  3692.   ERRCODE_SQLCOMMLOST           = 11;     { 0x0b Lost Communication with SQL server }
  3693.   ERRCODE_SERVERCOMMLOST        = 12;     { 0x0c Lost Communication with IDAPI server }
  3694.   ERRCODE_SQLSERVERNOTFOUND     = 13;     { 0x0d SQL Server not found }
  3695.   ERRCODE_SERVERNOTFOUND        = 14;     { 0x0e SQL Server not found }
  3696.  
  3697.   DBIERR_NETINITERR             = (ERRBASE_NETWORK + ERRCODE_NETINITERR);
  3698.   DBIERR_NETUSERLIMIT           = (ERRBASE_NETWORK + ERRCODE_NETUSERLIMIT);
  3699.   DBIERR_NETFILEVERSION         = (ERRBASE_NETWORK + ERRCODE_NETFILEVERSION);
  3700.   DBIERR_NETFILELOCKED          = (ERRBASE_NETWORK + ERRCODE_NETFILELOCKED);
  3701.   DBIERR_DIRNOTPRIVATE          = (ERRBASE_NETWORK + ERRCODE_DIRNOTPRIVATE);
  3702.   DBIERR_NETMULTIPLE            = (ERRBASE_NETWORK + ERRCODE_NETMULTIPLE);
  3703.   DBIERR_NETUNKNOWN             = (ERRBASE_NETWORK + ERRCODE_NETUNKNOWN);
  3704.   DBIERR_SHAREDFILE             = (ERRBASE_NETWORK + ERRCODE_SHAREDFILE);
  3705.   DBIERR_SHARENOTLOADED         = (ERRBASE_NETWORK + ERRCODE_SHARENOTLOADED);
  3706.   DBIERR_NOTONANETWORK          = (ERRBASE_NETWORK + ERRCODE_NOTONANETWORK);
  3707.   DBIERR_SQLCOMMLOST            = (ERRBASE_NETWORK + ERRCODE_SQLCOMMLOST);
  3708.   DBIERR_SERVERCOMMLOST         = (ERRBASE_NETWORK + ERRCODE_SERVERCOMMLOST);
  3709.   DBIERR_SQLSERVERNOTFOUND      = (ERRBASE_NETWORK + ERRCODE_SQLSERVERNOTFOUND);
  3710.   DBIERR_SERVERNOTFOUND         = (ERRBASE_NETWORK + ERRCODE_SERVERNOTFOUND);
  3711.  
  3712. { ERRCAT_DRIVER }
  3713. { ============= }
  3714.  
  3715.   ERRCODE_WRONGDRVNAME          = 1;      { Wrong driver name }
  3716.   ERRCODE_WRONGSYSVER           = 2;      { Wrong system version }
  3717.   ERRCODE_WRONGDRVVER           = 3;      { Wrong driver version }
  3718.   ERRCODE_WRONGDRVTYPE          = 4;      { Wrong driver type }
  3719.   ERRCODE_CANNOTLOADDRV         = 5;      { Can not load driver }
  3720.   ERRCODE_CANNOTLOADLDDRV       = 6;      { Can not load language driver }
  3721.   ERRCODE_VENDINITFAIL          = 7;      { Vendor init failure }
  3722.   ERRCODE_DRIVERRESTRICTED      = 8;      { Client not enabled for this driver }
  3723.  
  3724.  
  3725.   DBIERR_WRONGDRVNAME           = (ERRBASE_DRIVER + ERRCODE_WRONGDRVNAME);
  3726.   DBIERR_WRONGSYSVER            = (ERRBASE_DRIVER + ERRCODE_WRONGSYSVER);
  3727.   DBIERR_WRONGDRVVER            = (ERRBASE_DRIVER + ERRCODE_WRONGDRVVER);
  3728.   DBIERR_WRONGDRVTYPE           = (ERRBASE_DRIVER + ERRCODE_WRONGDRVTYPE);
  3729.   DBIERR_CANNOTLOADDRV          = (ERRBASE_DRIVER + ERRCODE_CANNOTLOADDRV);
  3730.   DBIERR_CANNOTLOADLDDRV        = (ERRBASE_DRIVER + ERRCODE_CANNOTLOADLDDRV);
  3731.   DBIERR_VENDINITFAIL           = (ERRBASE_DRIVER + ERRCODE_VENDINITFAIL);
  3732.   DBIERR_DRIVERRESTRICTED       = (ERRBASE_DRIVER + ERRCODE_DRIVERRESTRICTED);
  3733.  
  3734.  
  3735. { ERRCAT_QUERY }
  3736. { ============ }
  3737.  
  3738.  
  3739.  
  3740.   DBICODE_AMBJOASY              = 1;      { obsolete }
  3741.   DBICODE_AMBJOSYM              = 2;      { obsolete }
  3742.   DBICODE_AMBOUTEX              = 3;
  3743.   DBICODE_AMBOUTPR              = 4;      { obsolete }
  3744.   DBICODE_AMBSYMAS              = 5;      { obsolete }
  3745.   DBICODE_ASETOPER              = 6;
  3746.   DBICODE_AVENUMDA              = 7;
  3747.   DBICODE_BADEXPR1              = 8;
  3748.   DBICODE_BADFLDOR              = 9;
  3749.   DBICODE_BADVNAME              = 10;     { 0x0a }
  3750.   DBICODE_BITMAPER              = 11;     { 0x0b }
  3751.   DBICODE_CALCBADR              = 12;     { 0x0c }
  3752.   DBICODE_CALCTYPE              = 13;     { 0x0d }
  3753.   DBICODE_CHGTO1TI              = 14;     { 0x0e }
  3754.   DBICODE_CHGTOCHG              = 15;     { 0x0f }
  3755.   DBICODE_CHGTOEXP              = 16;     { 0x10 }
  3756.   DBICODE_CHGTOINS              = 17;     { 0x11 }
  3757.   DBICODE_CHGTONEW              = 18;     { 0x12 }
  3758.   DBICODE_CHGTOVAL              = 19;     { 0x13 }
  3759.   DBICODE_CHKMRKFI              = 20;     { 0x14 }
  3760.   DBICODE_CHNAMBIG              = 21;     { 0x15 }
  3761.   DBICODE_CHUNKERR              = 22;     { 0x16 }
  3762.   DBICODE_COLUM255              = 23;     { 0x17 }
  3763.   DBICODE_CONAFTAS              = 24;     { 0x18 }
  3764.   DBICODE_DEL1TIME              = 25;     { 0x19 }
  3765.   DBICODE_DELAMBIG              = 26;     { 0x1a }
  3766.   DBICODE_DELFRDEL              = 27;     { 0x1b }
  3767.   DBICODE_EGFLDTYP              = 28;     { 0x1c }
  3768.   DBICODE_EXAMINOR              = 29;     { 0x1d }
  3769.   DBICODE_EXPRTYPS              = 30;     { 0x1e }
  3770.   DBICODE_EXTRACOM              = 31;     { 0x1f }
  3771.   DBICODE_EXTRAORO              = 32;     { 0x20 }
  3772.   DBICODE_EXTRAQRO              = 33;     { 0x21 }
  3773.   DBICODE_FIND1ATT              = 34;     { 0x22 }
  3774.   DBICODE_FINDANST              = 35;     { 0x23 }
  3775.   DBICODE_GRPNOSET              = 36;     { 0x24 }
  3776.   DBICODE_GRPSTROW              = 37;     { 0x25 }
  3777.   DBICODE_IDFINLCO              = 38;     { 0x26 }
  3778.   DBICODE_IDFPERLI              = 39;     { 0x27 }
  3779.   DBICODE_INANEXPR              = 40;     { 0x28 }
  3780.   DBICODE_INS1TIME              = 41;     { 0x29 }
  3781.   DBICODE_INSAMBIG              = 42;     { 0x2a }
  3782.   DBICODE_INSDELCH              = 43;     { 0x2b }
  3783.   DBICODE_INSEXPRR              = 44;     { 0x2c }
  3784.   DBICODE_INSTOINS              = 45;     { 0x2d }
  3785.   DBICODE_ISARRAY               = 46;     { 0x2e }
  3786.   DBICODE_LABELERR              = 47;     { 0x2f }
  3787.   DBICODE_LINKCALC              = 48;     { 0x30 }
  3788.   DBICODE_LNGVNAME              = 49;     { 0x31 }
  3789.   DBICODE_LONGQURY              = 50;     { 0x32 }
  3790.   DBICODE_MEMVPROC              = 51;     { 0x33 }
  3791.   DBICODE_MISNGCOM              = 52;     { 0x34 }
  3792.   DBICODE_MISNGRPA              = 53;     { 0x35 }
  3793.   DBICODE_MISSRTQU              = 54;     { 0x36 }
  3794.   DBICODE_NAMTWICE              = 55;     { 0x37 }
  3795.   DBICODE_NOCHKMAR              = 56;     { 0x38 }
  3796.   DBICODE_NODEFOCC              = 57;     { 0x39 }
  3797.   DBICODE_NOGROUPS              = 58;     { 0x3a }
  3798.   DBICODE_NONSENSE              = 59;     { 0x3b }
  3799.   DBICODE_NOPATTER              = 60;     { 0x3c }
  3800.   DBICODE_NOSUCHDA              = 61;     { 0x3d }
  3801.   DBICODE_NOVALUE               = 62;     { 0x3e }
  3802.   DBICODE_ONLYCONS              = 63;     { 0x3f }
  3803.   DBICODE_ONLYSETR              = 64;     { 0x40 }
  3804.   DBICODE_OUTSENS1              = 65;     { 0x41 }
  3805.   DBICODE_OUTTWIC1              = 66;     { 0x42 }
  3806.   DBICODE_PAROWCNT              = 67;     { 0x43 }
  3807.   DBICODE_PERSEPAR              = 68;     { 0x44 }
  3808.   DBICODE_PROCPLSW              = 69;     { 0x45 }
  3809.   DBICODE_PWINSRTS              = 70;     { 0x46 }
  3810.   DBICODE_PWMODRTS              = 71;     { 0x47 }
  3811.   DBICODE_QBEFLDFOUND           = 72;     { 0x48 }
  3812.   DBICODE_QBENOFENCE            = 73;     { 0x49 }
  3813.   DBICODE_QBENOFENCET           = 74;     { 0x4a }
  3814.   DBICODE_QBENOHEADERT          = 75;     { 0x4b }
  3815.   DBICODE_QBENOTAB              = 76;     { 0x4c }
  3816.   DBICODE_QBENUMCOLS            = 77;     { 0x4d }
  3817.   DBICODE_QBEOPENTAB            = 78;     { 0x4e }
  3818.   DBICODE_QBETWICE              = 79;     { 0x4f }
  3819.   DBICODE_QRYNOANSWER           = 80;     { 0x50 }
  3820.   DBICODE_QRYNOTPREP            = 81;     { 0x51 }
  3821.   DBICODE_QUAINDEL              = 82;     { 0x52 }
  3822.   DBICODE_QUAININS              = 83;     { 0x53 }
  3823.   DBICODE_RAGININS              = 84;     { 0x54 }
  3824.   DBICODE_RAGINSET              = 85;     { 0x55 }
  3825.   DBICODE_ROWUSERR              = 86;     { 0x56 }
  3826.   DBICODE_SETEXPEC              = 87;     { 0x57 }
  3827.   DBICODE_SETVAMB1              = 88;     { 0x58 }
  3828.   DBICODE_SETVBAD1              = 89;     { 0x59 }
  3829.   DBICODE_SETVDEF1              = 90;     { 0x5a }
  3830.   DBICODE_SUMNUMBE              = 91;     { 0x5b }
  3831.   DBICODE_TBLISWP3              = 92;     { 0x5c }
  3832.   DBICODE_TOKENNOT              = 93;     { 0x5d }
  3833.   DBICODE_TWOOUTR1              = 94;     { 0x5e }
  3834.   DBICODE_TYPEMISM              = 95;     { 0x5f }
  3835.   DBICODE_UNRELQ1               = 96;     { 0x60 }
  3836.   DBICODE_UNUSEDST              = 97;     { 0x61 }
  3837.   DBICODE_USEINSDE              = 98;     { 0x62 }
  3838.   DBICODE_USEOFCHG              = 99;     { 0x63 }
  3839.   DBICODE_VARMUSTF              = 100;    { 0x64 }
  3840.   DBICODE_REGISTER              = 101;    { 0x65 }
  3841.   DBICODE_LONGEXPR              = 102;    { 0x66 }
  3842.   DBICODE_REFRESH               = 103;    { 0x67 }
  3843.   DBICODE_CANCEXCEPT            = 104;    { 0x68 }
  3844.   DBICODE_DBEXCEPT              = 105;    { 0x69 }
  3845.   DBICODE_MEMEXCEPT             = 106;    { 0x6a }
  3846.   DBICODE_FATALEXCEPT           = 107;    { 0x6b }
  3847.   DBICODE_QRYNIY                = 108;    { 0x6c }
  3848.   DBICODE_BADFORMAT             = 109;    { 0x6d }
  3849.   DBICODE_QRYEMPTY              = 110;    { 0x6e }
  3850.   DBICODE_NOQRYTOPREP           = 111;    { 0x6f }
  3851.   DBICODE_BUFFTOOSMALL          = 112;    { 0x70 }
  3852.   DBICODE_QRYNOTPARSE           = 113;    { 0x71 }
  3853.   DBICODE_NOTHANDLE             = 114;    { 0x72 }
  3854.   DBICODE_QRYSYNTERR            = 115;    { 0x73 }
  3855.   DBICODE_QXFLDCOUNT            = 116;    { 0x74 }
  3856.   DBICODE_QXFLDSYMNOTFOUND      = 117;    { 0x75 }
  3857.   DBICODE_QXTBLSYMNOTFOUND      = 118;    { 0x76 }
  3858.   DBICODE_BLOBTERM              = 119;    { 0x77 }
  3859.   DBICODE_BLOBERR               = 120;    { 0x78 }
  3860.   DBICODE_RESTARTQRY            = 121;    { 0x79 }
  3861.   DBICODE_UNKNOWNANSTYPE        = 122;    { 0x7a }
  3862.  
  3863. { Internal QBE use Only. }
  3864.   DBICODE_SQLG_MDIST            = 123;    { 0x7b }
  3865.   DBICODE_SQLG_NOARI            = 124;    { 0x7c }
  3866.   DBICODE_SQLG_LIKEN            = 125;    { 0x7d }
  3867.   DBICODE_SQLG_ALPHO            = 126;    { 0x7e }
  3868.   DBICODE_SQLG_DATEO            = 127;    { 0x7f }
  3869.   DBICODE_SQLG_RELOP            = 128;    { 0x80 }
  3870.   DBICODE_SQLG_ONLYC            = 129;    { 0x81 }
  3871.   DBICODE_SQLG_CNTLN            = 130;    { 0x82 }
  3872.   DBICODE_SQLG_CHINI            = 131;    { 0x83 }
  3873.   DBICODE_SQLG_UNION            = 132;    { 0x84 }
  3874.   DBICODE_SQLG_SLFIN            = 133;    { 0x85 }
  3875.   DBICODE_SQLG_OTJVR            = 134;    { 0x86 }
  3876.   DBICODE_SQLG_STROW            = 135;    { 0x87 }
  3877.   DBICODE_SQLG_QUANT            = 136;    { 0x88 }
  3878.   DBICODE_SQLG_REGSO            = 137;    { 0x89 }
  3879.   DBICODE_SQLG_COUNT            = 138;    { 0x8a }
  3880.   DBICODE_SQLG_AVERA            = 139;    { 0x8b }
  3881.   DBICODE_SQLG_DATEA            = 140;    { 0x8c }
  3882.   DBICODE_SQLG_BADPT            = 141;    { 0x8d }
  3883.   DBICODE_SQLG_RELPA            = 142;    { 0x8e }
  3884.   DBICODE_SQLG_PATRN            = 143;    { 0x8f }
  3885.   DBICODE_SQLG_FNDSU            = 144;    { 0x90 }
  3886.   DBICODE_SQLG_IFDCS            = 145;    { 0x91 }
  3887.   DBICODE_SQLG_IDCCO            = 146;    { 0x92 }
  3888.   DBICODE_SQLG_ONLYI            = 147;    { 0x93 }
  3889.   DBICODE_SQLG_SQLDIALECT       = 148;    { 0x94 }
  3890.   DBICODE_SQLG_NOQUERY          = 149;    { 0x95 }
  3891. { End of Internal.       }
  3892.  
  3893.   DBICODE_BLOBGROUP             = 150;    { 0x96 }
  3894.   DBICODE_QRYNOPROP             = 151;    { 0x97 }
  3895.   DBICODE_ANSTYPNOTSUP          = 152;    { 0x98 }
  3896.   DBICODE_ANSALIASNOTSUP        = 153;    { 0x99 }
  3897.   DBICODE_INSBLOBREQ            = 154;    { 0x9a }
  3898.   DBICODE_CHGUNIQUENDXREQ       = 155;    { 0x9b }
  3899.   DBICODE_DELUNIQUENDXREQ       = 156;    { 0x9c }
  3900.   DBICODE_SQLNOFULLUPDATE       = 157;    { 0x9d }
  3901.   DBICODE_CANTEXECREMOTE        = 158;    { 0x9e }
  3902.   DBICODE_UNEXPECTEDEOC         = 159;    { 0x9f }
  3903.   DBICODE_SQLPARAMNOTSET        = 160;    { 0xA0 }
  3904.   DBICODE_QUERYTOOLONG          = 161;    { 0xA1 }
  3905.  
  3906. { Errors added for localsql }
  3907.   DBICODE_NOSUCHRELORALIAS      = 170;
  3908.   DBICODE_TYPEAMBIGUITY         = 171;
  3909.   DBICODE_ORDERBYNOTAPROJ       = 172;
  3910.   DBICODE_SQLPARSE              = 173;
  3911.   DBICODE_CONSTRAINTFAILED      = 174;
  3912.   DBICODE_NOTGROUPINGFIELD      = 175;
  3913.   DBICODE_UDFNOTDEFINED         = 176;
  3914.   DBICODE_UDFERROR              = 177;
  3915.   DBICODE_SINGLEROWERROR        = 178;
  3916.   DBICODE_GROUPEXPR             = 179;
  3917.   DBICODE_QUERYTEXT             = 180;
  3918.   DBICODE_ANSIJOINSUP           = 181;
  3919.   DBICODE_DISTUNION             = 182;
  3920.   DBICODE_GROUPBYREQ            = 183;
  3921.   DBICODE_INSUPDAUTOIC          = 184;
  3922.   DBICODE_UPDREFINTSINGLE       = 185;
  3923.   DBICODE_NOMSACCESS            = 186;
  3924.   DBICODE_FIELDCONSTPREP        = 187;
  3925.   DBICODE_FIELDDEFPREP          = 188;
  3926.   DBICODE_RECCONSTPREP          = 189;
  3927.  
  3928.   DBICODE_TOOFEWSUBEXPR         = 190;    { 0xBE }
  3929.   DBICODE_TOOMANYSUBEXPR        = 191;    { 0xBF }
  3930.   DBICODE_INVALIDNODETYPE       = 192;    { 0xC0 }
  3931.   DBICODE_BOOLEXPR              = 193;    { 0xC1 }
  3932.   DBICODE_NONBOOLEXPR           = 194;    { 0xC2 }
  3933.   DBICODE_NOOUTERJOIN           = 195;    { 0xC3 }
  3934.   DBICODE_USERCONSTRERR         = 196;    { 0xC4 }
  3935.  
  3936.  
  3937.   DBIERR_AMBJOASY               = (ERRBASE_QUERY+DBICODE_AMBJOASY);
  3938.   DBIERR_AMBJOSYM               = (ERRBASE_QUERY+DBICODE_AMBJOSYM);
  3939.   DBIERR_AMBOUTEX               = (ERRBASE_QUERY+DBICODE_AMBOUTEX);
  3940.   DBIERR_AMBOUTPR               = (ERRBASE_QUERY+DBICODE_AMBOUTPR);
  3941.   DBIERR_AMBSYMAS               = (ERRBASE_QUERY+DBICODE_AMBSYMAS);
  3942.   DBIERR_ASETOPER               = (ERRBASE_QUERY+DBICODE_ASETOPER);
  3943.   DBIERR_AVENUMDA               = (ERRBASE_QUERY+DBICODE_AVENUMDA);
  3944.   DBIERR_BADEXPR1               = (ERRBASE_QUERY+DBICODE_BADEXPR1);
  3945.   DBIERR_BADFLDOR               = (ERRBASE_QUERY+DBICODE_BADFLDOR);
  3946.   DBIERR_BADVNAME               = (ERRBASE_QUERY+DBICODE_BADVNAME);
  3947.   DBIERR_BITMAPER               = (ERRBASE_QUERY+DBICODE_BITMAPER);
  3948.   DBIERR_CALCBADR               = (ERRBASE_QUERY+DBICODE_CALCBADR);
  3949.   DBIERR_CALCTYPE               = (ERRBASE_QUERY+DBICODE_CALCTYPE);
  3950.   DBIERR_CHGTO1TI               = (ERRBASE_QUERY+DBICODE_CHGTO1TI);
  3951.   DBIERR_CHGTOCHG               = (ERRBASE_QUERY+DBICODE_CHGTOCHG);
  3952.   DBIERR_CHGTOEXP               = (ERRBASE_QUERY+DBICODE_CHGTOEXP);
  3953.   DBIERR_CHGTOINS               = (ERRBASE_QUERY+DBICODE_CHGTOINS);
  3954.   DBIERR_CHGTONEW               = (ERRBASE_QUERY+DBICODE_CHGTONEW);
  3955.   DBIERR_CHGTOVAL               = (ERRBASE_QUERY+DBICODE_CHGTOVAL);
  3956.   DBIERR_CHKMRKFI               = (ERRBASE_QUERY+DBICODE_CHKMRKFI);
  3957.   DBIERR_CHNAMBIG               = (ERRBASE_QUERY+DBICODE_CHNAMBIG);
  3958.   DBIERR_CHUNKERR               = (ERRBASE_QUERY+DBICODE_CHUNKERR);
  3959.   DBIERR_COLUM255               = (ERRBASE_QUERY+DBICODE_COLUM255);
  3960.   DBIERR_CONAFTAS               = (ERRBASE_QUERY+DBICODE_CONAFTAS);
  3961.   DBIERR_DEL1TIME               = (ERRBASE_QUERY+DBICODE_DEL1TIME);
  3962.   DBIERR_DELAMBIG               = (ERRBASE_QUERY+DBICODE_DELAMBIG);
  3963.   DBIERR_DELFRDEL               = (ERRBASE_QUERY+DBICODE_DELFRDEL);
  3964.   DBIERR_EGFLDTYP               = (ERRBASE_QUERY+DBICODE_EGFLDTYP);
  3965.   DBIERR_EXAMINOR               = (ERRBASE_QUERY+DBICODE_EXAMINOR);
  3966.   DBIERR_EXPRTYPS               = (ERRBASE_QUERY+DBICODE_EXPRTYPS);
  3967.   DBIERR_EXTRACOM               = (ERRBASE_QUERY+DBICODE_EXTRACOM);
  3968.   DBIERR_EXTRAORO               = (ERRBASE_QUERY+DBICODE_EXTRAORO);
  3969.   DBIERR_EXTRAQRO               = (ERRBASE_QUERY+DBICODE_EXTRAQRO);
  3970.   DBIERR_FIND1ATT               = (ERRBASE_QUERY+DBICODE_FIND1ATT);
  3971.   DBIERR_FINDANST               = (ERRBASE_QUERY+DBICODE_FINDANST);
  3972.   DBIERR_GRPNOSET               = (ERRBASE_QUERY+DBICODE_GRPNOSET);
  3973.   DBIERR_GRPSTROW               = (ERRBASE_QUERY+DBICODE_GRPSTROW);
  3974.   DBIERR_IDFINLCO               = (ERRBASE_QUERY+DBICODE_IDFINLCO);
  3975.   DBIERR_IDFPERLI               = (ERRBASE_QUERY+DBICODE_IDFPERLI);
  3976.   DBIERR_INANEXPR               = (ERRBASE_QUERY+DBICODE_INANEXPR);
  3977.   DBIERR_INS1TIME               = (ERRBASE_QUERY+DBICODE_INS1TIME);
  3978.   DBIERR_INSAMBIG               = (ERRBASE_QUERY+DBICODE_INSAMBIG);
  3979.   DBIERR_INSDELCH               = (ERRBASE_QUERY+DBICODE_INSDELCH);
  3980.   DBIERR_INSEXPRR               = (ERRBASE_QUERY+DBICODE_INSEXPRR);
  3981.   DBIERR_INSTOINS               = (ERRBASE_QUERY+DBICODE_INSTOINS);
  3982.   DBIERR_ISARRAY                = (ERRBASE_QUERY+DBICODE_ISARRAY);
  3983.   DBIERR_LABELERR               = (ERRBASE_QUERY+DBICODE_LABELERR);
  3984.   DBIERR_LINKCALC               = (ERRBASE_QUERY+DBICODE_LINKCALC);
  3985.   DBIERR_LNGVNAME               = (ERRBASE_QUERY+DBICODE_LNGVNAME);
  3986.   DBIERR_LONGQURY               = (ERRBASE_QUERY+DBICODE_LONGQURY);
  3987.   DBIERR_MEMVPROC               = (ERRBASE_QUERY+DBICODE_MEMVPROC);
  3988.   DBIERR_MISNGCOM               = (ERRBASE_QUERY+DBICODE_MISNGCOM);
  3989.   DBIERR_MISNGRPA               = (ERRBASE_QUERY+DBICODE_MISNGRPA);
  3990.   DBIERR_MISSRTQU               = (ERRBASE_QUERY+DBICODE_MISSRTQU);
  3991.   DBIERR_NAMTWICE               = (ERRBASE_QUERY+DBICODE_NAMTWICE);
  3992.   DBIERR_NOCHKMAR               = (ERRBASE_QUERY+DBICODE_NOCHKMAR);
  3993.   DBIERR_NODEFOCC               = (ERRBASE_QUERY+DBICODE_NODEFOCC);
  3994.   DBIERR_NOGROUPS               = (ERRBASE_QUERY+DBICODE_NOGROUPS);
  3995.   DBIERR_NONSENSE               = (ERRBASE_QUERY+DBICODE_NONSENSE);
  3996.   DBIERR_NOPATTER               = (ERRBASE_QUERY+DBICODE_NOPATTER);
  3997.   DBIERR_NOSUCHDA               = (ERRBASE_QUERY+DBICODE_NOSUCHDA);
  3998.   DBIERR_NOVALUE                = (ERRBASE_QUERY+DBICODE_NOVALUE);
  3999.   DBIERR_ONLYCONS               = (ERRBASE_QUERY+DBICODE_ONLYCONS);
  4000.   DBIERR_ONLYSETR               = (ERRBASE_QUERY+DBICODE_ONLYSETR);
  4001.   DBIERR_OUTSENS1               = (ERRBASE_QUERY+DBICODE_OUTSENS1);
  4002.   DBIERR_OUTTWIC1               = (ERRBASE_QUERY+DBICODE_OUTTWIC1);
  4003.   DBIERR_PAROWCNT               = (ERRBASE_QUERY+DBICODE_PAROWCNT);
  4004.   DBIERR_PERSEPAR               = (ERRBASE_QUERY+DBICODE_PERSEPAR);
  4005.   DBIERR_PROCPLSW               = (ERRBASE_QUERY+DBICODE_PROCPLSW);
  4006.   DBIERR_PWINSRTS               = (ERRBASE_QUERY+DBICODE_PWINSRTS);
  4007.   DBIERR_PWMODRTS               = (ERRBASE_QUERY+DBICODE_PWMODRTS);
  4008.   DBIERR_QBEFLDFOUND            = (ERRBASE_QUERY+DBICODE_QBEFLDFOUND);
  4009.   DBIERR_QBENOFENCE             = (ERRBASE_QUERY+DBICODE_QBENOFENCE);
  4010.   DBIERR_QBENOFENCET            = (ERRBASE_QUERY+DBICODE_QBENOFENCET);
  4011.   DBIERR_QBENOHEADERT           = (ERRBASE_QUERY+DBICODE_QBENOHEADERT);
  4012.   DBIERR_QBENOTAB               = (ERRBASE_QUERY+DBICODE_QBENOTAB);
  4013.   DBIERR_QBENUMCOLS             = (ERRBASE_QUERY+DBICODE_QBENUMCOLS);
  4014.   DBIERR_QBEOPENTAB             = (ERRBASE_QUERY+DBICODE_QBEOPENTAB);
  4015.   DBIERR_QBETWICE               = (ERRBASE_QUERY+DBICODE_QBETWICE);
  4016.   DBIERR_QRYNOANSWER            = (ERRBASE_QUERY+DBICODE_QRYNOANSWER);
  4017.   DBIERR_QRYNOTPREP             = (ERRBASE_QUERY+DBICODE_QRYNOTPREP);
  4018.   DBIERR_QUAINDEL               = (ERRBASE_QUERY+DBICODE_QUAINDEL);
  4019.   DBIERR_QUAININS               = (ERRBASE_QUERY+DBICODE_QUAININS);
  4020.   DBIERR_RAGININS               = (ERRBASE_QUERY+DBICODE_RAGININS);
  4021.   DBIERR_RAGINSET               = (ERRBASE_QUERY+DBICODE_RAGINSET);
  4022.   DBIERR_ROWUSERR               = (ERRBASE_QUERY+DBICODE_ROWUSERR);
  4023.   DBIERR_SETEXPEC               = (ERRBASE_QUERY+DBICODE_SETEXPEC);
  4024.   DBIERR_SETVAMB1               = (ERRBASE_QUERY+DBICODE_SETVAMB1);
  4025.   DBIERR_SETVBAD1               = (ERRBASE_QUERY+DBICODE_SETVBAD1);
  4026.   DBIERR_SETVDEF1               = (ERRBASE_QUERY+DBICODE_SETVDEF1);
  4027.   DBIERR_SUMNUMBE               = (ERRBASE_QUERY+DBICODE_SUMNUMBE);
  4028.   DBIERR_TBLISWP3               = (ERRBASE_QUERY+DBICODE_TBLISWP3);
  4029.   DBIERR_TOKENNOT               = (ERRBASE_QUERY+DBICODE_TOKENNOT);
  4030.   DBIERR_TWOOUTR1               = (ERRBASE_QUERY+DBICODE_TWOOUTR1);
  4031.   DBIERR_TYPEMISM               = (ERRBASE_QUERY+DBICODE_TYPEMISM);
  4032.   DBIERR_UNRELQ1                = (ERRBASE_QUERY+DBICODE_UNRELQ1);
  4033.   DBIERR_UNUSEDST               = (ERRBASE_QUERY+DBICODE_UNUSEDST);
  4034.   DBIERR_USEINSDE               = (ERRBASE_QUERY+DBICODE_USEINSDE);
  4035.   DBIERR_USEOFCHG               = (ERRBASE_QUERY+DBICODE_USEOFCHG);
  4036.   DBIERR_VARMUSTF               = (ERRBASE_QUERY+DBICODE_VARMUSTF);
  4037.   DBIERR_REGISTER               = (ERRBASE_QUERY+DBICODE_REGISTER);
  4038.   DBIERR_LONGEXPR               = (ERRBASE_QUERY+DBICODE_LONGEXPR);
  4039.   DBIERR_REFRESH                = (ERRBASE_QUERY+DBICODE_REFRESH);
  4040.   DBIERR_CANCEXCEPT             = (ERRBASE_QUERY+DBICODE_CANCEXCEPT);
  4041.   DBIERR_DBEXCEPT               = (ERRBASE_QUERY+DBICODE_DBEXCEPT);
  4042.   DBIERR_MEMEXCEPT              = (ERRBASE_QUERY+DBICODE_MEMEXCEPT);
  4043.   DBIERR_FATALEXCEPT            = (ERRBASE_QUERY+DBICODE_FATALEXCEPT);
  4044.   DBIERR_QRYNIY                 = (ERRBASE_QUERY+ DBICODE_QRYNIY);
  4045.   DBIERR_BADFORMAT              = (ERRBASE_QUERY+ DBICODE_BADFORMAT);
  4046.   DBIERR_QRYEMPTY               = (ERRBASE_QUERY+ DBICODE_QRYEMPTY);
  4047.   DBIERR_NOQRYTOPREP            = (ERRBASE_QUERY+ DBICODE_NOQRYTOPREP);
  4048.   DBIERR_BUFFTOOSMALL           = (ERRBASE_QUERY+ DBICODE_BUFFTOOSMALL);
  4049.   DBIERR_QRYNOTPARSE            = (ERRBASE_QUERY+ DBICODE_QRYNOTPARSE);
  4050.   DBIERR_NOTHANDLE              = (ERRBASE_QUERY+ DBICODE_NOTHANDLE);
  4051.   DBIERR_QRYSYNTERR             = (ERRBASE_QUERY+ DBICODE_QRYSYNTERR);
  4052.   DBIERR_QXFLDCOUNT             = (ERRBASE_QUERY+ DBICODE_QXFLDCOUNT);
  4053.   DBIERR_QXFLDSYMNOTFOUND       = (ERRBASE_QUERY+ DBICODE_QXFLDSYMNOTFOUND);
  4054.   DBIERR_QXTBLSYMNOTFOUND       = (ERRBASE_QUERY+ DBICODE_QXTBLSYMNOTFOUND);
  4055.   DBIERR_BLOBTERM               = (ERRBASE_QUERY+ DBICODE_BLOBTERM);
  4056.   DBIERR_BLOBERR                = (ERRBASE_QUERY+ DBICODE_BLOBERR);
  4057.   DBIERR_RESTARTQRY             = (ERRBASE_QUERY+ DBICODE_RESTARTQRY);
  4058.   DBIERR_UNKNOWNANSTYPE         = (ERRBASE_QUERY+ DBICODE_UNKNOWNANSTYPE);
  4059.   DBIERR_SQLG_MDIST             = (ERRBASE_QUERY+ DBICODE_SQLG_MDIST);
  4060.   DBIERR_SQLG_NOARI             = (ERRBASE_QUERY+ DBICODE_SQLG_NOARI);
  4061.   DBIERR_SQLG_LIKEN             = (ERRBASE_QUERY+ DBICODE_SQLG_LIKEN);
  4062.   DBIERR_SQLG_ALPHO             = (ERRBASE_QUERY+ DBICODE_SQLG_ALPHO);
  4063.   DBIERR_SQLG_DATEO             = (ERRBASE_QUERY+ DBICODE_SQLG_DATEO);
  4064.   DBIERR_SQLG_RELOP             = (ERRBASE_QUERY+ DBICODE_SQLG_RELOP);
  4065.   DBIERR_SQLG_ONLYC             = (ERRBASE_QUERY+ DBICODE_SQLG_ONLYC);
  4066.   DBIERR_SQLG_CNTLN             = (ERRBASE_QUERY+ DBICODE_SQLG_CNTLN);
  4067.   DBIERR_SQLG_CHINI             = (ERRBASE_QUERY+ DBICODE_SQLG_CHINI);
  4068.   DBIERR_SQLG_UNION             = (ERRBASE_QUERY+ DBICODE_SQLG_UNION);
  4069.   DBIERR_SQLG_SLFIN             = (ERRBASE_QUERY+ DBICODE_SQLG_SLFIN);
  4070.   DBIERR_SQLG_OTJVR             = (ERRBASE_QUERY+ DBICODE_SQLG_OTJVR);
  4071.   DBIERR_SQLG_STROW             = (ERRBASE_QUERY+ DBICODE_SQLG_STROW);
  4072.   DBIERR_SQLG_QUANT             = (ERRBASE_QUERY+ DBICODE_SQLG_QUANT);
  4073.   DBIERR_SQLG_REGSO             = (ERRBASE_QUERY+ DBICODE_SQLG_REGSO);
  4074.   DBIERR_SQLG_COUNT             = (ERRBASE_QUERY+ DBICODE_SQLG_COUNT);
  4075.   DBIERR_SQLG_AVERA             = (ERRBASE_QUERY+ DBICODE_SQLG_AVERA);
  4076.   DBIERR_SQLG_DATEA             = (ERRBASE_QUERY+ DBICODE_SQLG_DATEA);
  4077.   DBIERR_SQLG_BADPT             = (ERRBASE_QUERY+ DBICODE_SQLG_BADPT);
  4078.   DBIERR_SQLG_RELPA             = (ERRBASE_QUERY+ DBICODE_SQLG_RELPA);
  4079.   DBIERR_SQLG_PATRN             = (ERRBASE_QUERY+ DBICODE_SQLG_PATRN);
  4080.   DBIERR_SQLG_FNDSU             = (ERRBASE_QUERY+ DBICODE_SQLG_FNDSU);
  4081.   DBIERR_SQLG_IFDCS             = (ERRBASE_QUERY+ DBICODE_SQLG_IFDCS);
  4082.   DBIERR_SQLG_IDCCO             = (ERRBASE_QUERY+ DBICODE_SQLG_IDCCO);
  4083.   DBIERR_SQLG_ONLYI             = (ERRBASE_QUERY+ DBICODE_SQLG_ONLYI);
  4084.   DBIERR_SQLG_SQLDIALECT        = (ERRBASE_QUERY+ DBICODE_SQLG_SQLDIALECT);
  4085.   DBIERR_SQLG_NOQUERY           = (ERRBASE_QUERY+ DBICODE_SQLG_NOQUERY);
  4086.   DBIERR_BLOBGROUP              = (ERRBASE_QUERY+ DBICODE_BLOBGROUP);
  4087.   DBIERR_QRYNOPROP              = (ERRBASE_QUERY+DBICODE_QRYNOPROP);
  4088.   DBIERR_ANSTYPNOTSUP           = (ERRBASE_QUERY+DBICODE_ANSTYPNOTSUP);
  4089.   DBIERR_ANSALIASNOTSUP         = (ERRBASE_QUERY+DBICODE_ANSALIASNOTSUP);
  4090.   DBIERR_INSBLOBREQ             = (ERRBASE_QUERY+DBICODE_INSBLOBREQ     ); { 0x9a }
  4091.   DBIERR_CHGUNIQUENDXREQ        = (ERRBASE_QUERY+DBICODE_CHGUNIQUENDXREQ); { 0x9b }
  4092.   DBIERR_DELUNIQUENDXREQ        = (ERRBASE_QUERY+DBICODE_DELUNIQUENDXREQ); { 0x9c }
  4093.   DBIERR_SQLNOFULLUPDATE        = (ERRBASE_QUERY+DBICODE_SQLNOFULLUPDATE); { 0x9d }
  4094.   DBIERR_CANTEXECREMOTE         = (ERRBASE_QUERY+DBICODE_CANTEXECREMOTE); { 0x9e }
  4095.   DBIERR_UNEXPECTEDEOC          = (ERRBASE_QUERY+DBICODE_UNEXPECTEDEOC);
  4096.   DBIERR_SQLPARAMNOTSET         = (ERRBASE_QUERY+DBICODE_SQLPARAMNOTSET);
  4097.   DBIERR_QUERYTOOLONG           = (ERRBASE_QUERY+DBICODE_QUERYTOOLONG);
  4098.  
  4099.   DBIERR_NOSUCHRELORALIAS       = (ERRBASE_QUERY+DBICODE_NOSUCHRELORALIAS);
  4100.   DBIERR_TYPEAMBIGUITY          = (ERRBASE_QUERY+DBICODE_TYPEAMBIGUITY);
  4101.   DBIERR_ORDERBYNOTAPROJ        = (ERRBASE_QUERY+DBICODE_ORDERBYNOTAPROJ);
  4102.   DBIERR_SQLPARSE               = (ERRBASE_QUERY+DBICODE_SQLPARSE);
  4103.   DBIERR_CONSTRAINTFAILED       = (ERRBASE_QUERY+DBICODE_CONSTRAINTFAILED);
  4104.   DBIERR_NOTGROUPINGFIELD       = (ERRBASE_QUERY+DBICODE_NOTGROUPINGFIELD);
  4105.   DBIERR_UDFNOTDEFINED          = (ERRBASE_QUERY+DBICODE_UDFNOTDEFINED);
  4106.   DBIERR_UDFERROR               = (ERRBASE_QUERY+DBICODE_UDFERROR);
  4107.   DBIERR_SINGLEROWERROR         = (ERRBASE_QUERY+DBICODE_SINGLEROWERROR);
  4108.   DBIERR_GROUPEXPR              = (ERRBASE_QUERY+DBICODE_GROUPEXPR);
  4109.   DBIERR_QUERYTEXT              = (ERRBASE_QUERY+DBICODE_QUERYTEXT);
  4110.   DBIERR_ANSIJOINSUP            = (ERRBASE_QUERY+DBICODE_ANSIJOINSUP);
  4111.   DBIERR_DISTUNION              = (ERRBASE_QUERY+DBICODE_DISTUNION);
  4112.   DBIERR_GROUPBYREQ             = (ERRBASE_QUERY+DBICODE_GROUPBYREQ);
  4113.   DBIERR_INSUPDAUTOINC          = (ERRBASE_QUERY+DBICODE_INSUPDAUTOIC);
  4114.   DBIERR_UPDREFINTSINGLE        = (ERRBASE_QUERY+DBICODE_UPDREFINTSINGLE);
  4115.   DBIERR_NOMSACCESS             = (ERRBASE_QUERY+DBICODE_NOMSACCESS);
  4116.   DBIERR_FIELDCONSTPREP         = (ERRBASE_QUERY+DBICODE_FIELDCONSTPREP);
  4117.   DBIERR_FIELDDEFPREP           = (ERRBASE_QUERY+DBICODE_FIELDDEFPREP);
  4118.   DBIERR_RECCONSTPREP           = (ERRBASE_QUERY+DBICODE_RECCONSTPREP);
  4119.  
  4120.   DBIERR_TOOFEWSUBEXPR          = (ERRBASE_QUERY+DBICODE_TOOFEWSUBEXPR);
  4121.   DBIERR_TOOMANYSUBEXPR         = (ERRBASE_QUERY+DBICODE_TOOMANYSUBEXPR);
  4122.   DBIERR_INVALIDNODETYPE        = (ERRBASE_QUERY+DBICODE_INVALIDNODETYPE);
  4123.   DBIERR_BOOLEXPR               = (ERRBASE_QUERY+DBICODE_BOOLEXPR);
  4124.   DBIERR_NONBOOLEXPR            = (ERRBASE_QUERY+DBICODE_NONBOOLEXPR);
  4125.   DBIERR_NOOUTERJOIN            = (ERRBASE_QUERY+DBICODE_NOOUTERJOIN);
  4126.   DBIERR_USERCONSTRERR          = (ERRBASE_QUERY+DBICODE_USERCONSTRERR);
  4127.  
  4128. { END_OF_QUERY_MESSAGES }
  4129.  
  4130. { ERRCAT_VERSION }
  4131. { ============== }
  4132.  
  4133.   ERRCODE_INTERFACEVER          = 1;      { Interface mismatch }
  4134.   ERRCODE_INDEXOUTOFDATE        = 2;      { Index is out of date }
  4135.   ERRCODE_OLDVERSION            = 3;      { Older version (see context) }
  4136.   ERRCODE_VALFILEINVALID        = 4;      { Val. file is out of date }
  4137.   ERRCODE_BLOBVERSION           = 5;      { Old Blob file version }
  4138.   ERRCODE_ENGQRYMISMATCH        = 6;      { Query and IDAPI are mismatched }
  4139.   ERRCODE_SERVERVERSION         = 7;      { Server is incompatible version }
  4140.   ERRCODE_TABLELEVEL            = 8;      { Higher table level required }
  4141.  
  4142.   DBIERR_INTERFACEVER           = (ERRBASE_VERSION + ERRCODE_INTERFACEVER);
  4143.   DBIERR_INDEXOUTOFDATE         = (ERRBASE_VERSION + ERRCODE_INDEXOUTOFDATE);
  4144.   DBIERR_OLDVERSION             = (ERRBASE_VERSION + ERRCODE_OLDVERSION);
  4145.   DBIERR_VALFILEINVALID         = (ERRBASE_VERSION + ERRCODE_VALFILEINVALID);
  4146.   DBIERR_BLOBVERSION            = (ERRBASE_VERSION + ERRCODE_BLOBVERSION);
  4147.   DBIERR_ENGQRYMISMATCH         = (ERRBASE_VERSION + ERRCODE_ENGQRYMISMATCH);
  4148.   DBIERR_SERVERVERSION          = (ERRBASE_VERSION + ERRCODE_SERVERVERSION);
  4149.   DBIERR_TABLELEVEL             = (ERRBASE_VERSION + ERRCODE_TABLELEVEL);
  4150.  
  4151. { ERRCAT_CAPABILITY }
  4152. { ================= }
  4153.  
  4154.   ERRCODE_NOTSUPPORTED          = 1;      { Capability not supported }
  4155.   ERRCODE_NIY                   = 2;      { Not Implemented Yet }
  4156.   ERRCODE_TABLESQL              = 3;      { Cannot access SQL replica }
  4157.   ERRCODE_SEARCHCOLREQD         = 4;      { Searchable (Non-blob column) required }
  4158.   ERRCODE_NOMULTCONNECT         = 5;      { Multiple connections not supported }
  4159.   ERRCODE_NODBASEEXPR           = 6;      { Full dBASE Expressions not supported }
  4160.   ERRCODE_NONESTEDTRAN          = 7;      { Nested transactions not supported }
  4161.  
  4162.   DBIERR_NOTSUPPORTED           = (ERRBASE_CAPABILITY + ERRCODE_NOTSUPPORTED);
  4163.   DBIERR_NIY                    = (ERRBASE_CAPABILITY + ERRCODE_NIY);
  4164.   DBIERR_TABLESQL               = (ERRBASE_CAPABILITY + ERRCODE_TABLESQL);
  4165.   DBIERR_SEARCHCOLREQD          = (ERRBASE_CAPABILITY + ERRCODE_SEARCHCOLREQD);
  4166.   DBIERR_NOMULTCONNECT          = (ERRBASE_CAPABILITY + ERRCODE_NOMULTCONNECT);
  4167.   DBIERR_NODBASEEXPR            = (ERRBASE_CAPABILITY + ERRCODE_NODBASEEXPR);
  4168.   DBIERR_NONESTEDTRAN           = (ERRBASE_CAPABILITY + ERRCODE_NONESTEDTRAN);
  4169.  
  4170. { ERRCAT_CONFIG }
  4171. { ============= }
  4172.  
  4173.   ERRCODE_INVALIDDBSPEC         = 1;
  4174.   ERRCODE_UNKNOWNDBTYPE         = 2;
  4175.   ERRCODE_INVALIDSYSDATA        = 3;
  4176.   ERRCODE_UNKNOWNNETTYPE        = 4;
  4177.   ERRCODE_NOTONTHATNET          = 5;
  4178.   ERRCODE_INVALIDCFGPARAM       = 6;      { Generic invalid config param }
  4179.  
  4180.  
  4181.   DBIERR_INVALIDDBSPEC          = (ERRBASE_CONFIG + ERRCODE_INVALIDDBSPEC);
  4182.   DBIERR_UNKNOWNDBTYPE          = (ERRBASE_CONFIG + ERRCODE_UNKNOWNDBTYPE);
  4183.   DBIERR_INVALIDSYSDATA         = (ERRBASE_CONFIG + ERRCODE_INVALIDSYSDATA);
  4184.   DBIERR_UNKNOWNNETTYPE         = (ERRBASE_CONFIG + ERRCODE_UNKNOWNNETTYPE);
  4185.   DBIERR_NOTONTHATNET           = (ERRBASE_CONFIG + ERRCODE_NOTONTHATNET);
  4186.   DBIERR_INVALIDCFGPARAM        = (ERRBASE_CONFIG + ERRCODE_INVALIDCFGPARAM);
  4187.  
  4188. { ERRCAT_WARNING  non-fatal warnings:               }
  4189. { warn user of action, or ask for optional behavior }
  4190. { ================================================= }
  4191.   ERRCODE_OBJIMPLICITLYDROPPED  = 1;
  4192.   ERRCODE_OBJMAYBETRUNCATED     = 2;
  4193.   ERRCODE_OBJIMPLICITLYMODIFIED = 3;
  4194.   ERRCODE_VALIDATEDATA          = 4;
  4195.   ERRCODE_VALFIELDMODIFIED      = 5;
  4196.   ERRCODE_TABLELEVELCHANGED     = 6;
  4197.   ERRCODE_COPYLINKEDTABLES      = 7;
  4198.   ERRCODE_OTHERSERVERLOADED     = 8;
  4199.   ERRCODE_OBJIMPLICITLYTRUNCATED = 9;
  4200.   ERRCODE_VCHKMAYNOTBEENFORCED  = 10;
  4201.   ERRCODE_MULTIPLEUNIQRECS      = 11;
  4202.   ERRCODE_FIELDMUSTBETRIMMED    = 12;
  4203.  
  4204.   DBIERR_OBJIMPLICITLYDROPPED   = ( ERRBASE_WARNING + ERRCODE_OBJIMPLICITLYDROPPED);
  4205.   DBIERR_OBJMAYBETRUNCATED      = ( ERRBASE_WARNING + ERRCODE_OBJMAYBETRUNCATED);
  4206.   DBIERR_OBJIMPLICITLYMODIFIED  = ( ERRBASE_WARNING + ERRCODE_OBJIMPLICITLYMODIFIED);
  4207.   DBIERR_VALIDATEDATA           = ( ERRBASE_WARNING + ERRCODE_VALIDATEDATA);
  4208.   DBIERR_VALFIELDMODIFIED       = ( ERRBASE_WARNING + ERRCODE_VALFIELDMODIFIED);
  4209.   DBIERR_TABLELEVELCHANGED      = ( ERRBASE_WARNING + ERRCODE_TABLELEVELCHANGED);
  4210.   DBIERR_COPYLINKEDTABLES       = ( ERRBASE_WARNING + ERRCODE_COPYLINKEDTABLES);
  4211.   DBIERR_OTHERSERVERLOADED      = ( ERRBASE_WARNING + ERRCODE_OTHERSERVERLOADED);
  4212.   DBIERR_OBJIMPLICITLYTRUNCATED = ( ERRBASE_WARNING + ERRCODE_OBJIMPLICITLYTRUNCATED);
  4213.   DBIERR_VCHKMAYNOTBEENFORCED   = ( ERRBASE_WARNING + ERRCODE_VCHKMAYNOTBEENFORCED );
  4214.   DBIERR_MULTIPLEUNIQRECS       = ( ERRBASE_WARNING + ERRCODE_MULTIPLEUNIQRECS );
  4215.   DBIERR_FIELDMUSTBETRIMMED     = ( ERRBASE_WARNING + ERRCODE_FIELDMUSTBETRIMMED );
  4216.  
  4217.  
  4218. { ERRCAT_OTHER }
  4219. { ============ }
  4220.  
  4221.   ERRCODE_FILEEXISTS            = 1;      { File already exsits }
  4222.   ERRCODE_BLOBMODIFIED          = 2;      { Another user modified Blob }
  4223.   ERRCODE_UNKNOWNSQL            = 3;      { Unknown SQL error }
  4224.   ERRCODE_TABLEEXISTS           = 4;      { Table already exsits }
  4225.   ERRCODE_PDX10TABLE            = 5;      { Paradox 1.0 tables not supported }
  4226.   ERRCODE_UPDATEABORT           = 6;      { Update operation aborted }
  4227.  
  4228.  
  4229.   DBIERR_FILEEXISTS             = (ERRBASE_OTHER + ERRCODE_FILEEXISTS);
  4230.   DBIERR_BLOBMODIFIED           = (ERRBASE_OTHER + ERRCODE_BLOBMODIFIED);
  4231.   DBIERR_UNKNOWNSQL             = (ERRBASE_OTHER + ERRCODE_UNKNOWNSQL);
  4232.   DBIERR_TABLEEXISTS            = (ERRBASE_OTHER + ERRCODE_TABLEEXISTS);
  4233.   DBIERR_PDX10TABLE             = (ERRBASE_OTHER + ERRCODE_PDX10TABLE);
  4234.   DBIERR_UPDATEABORT            = (ERRBASE_OTHER + ERRCODE_UPDATEABORT);
  4235.  
  4236.  
  4237. { ERRCAT_COMPATIBILITY }
  4238. { ==================== }
  4239.  
  4240.   ERRCODE_DIFFSORTORDER         = 1;      { Sortorders not compatible }
  4241.   ERRCODE_DIRINUSEBYOLDVER      = 2;      { Directory in use by old version }
  4242.   ERRCODE_PDX35LDDRIVER         = 3;      { Needs Pdox 3.5 compatible language driver }
  4243.  
  4244.   DBIERR_DIFFSORTORDER          = (ERRBASE_COMPATIBILITY + ERRCODE_DIFFSORTORDER);
  4245.   DBIERR_DIRINUSEBYOLDVER       = (ERRBASE_COMPATIBILITY + ERRCODE_DIRINUSEBYOLDVER);
  4246.   DBIERR_PDX35LDDRIVER          = (ERRBASE_COMPATIBILITY + ERRCODE_PDX35LDDRIVER);
  4247.  
  4248. { ERRCAT_OPTPARAM }
  4249. { =============== }
  4250.  
  4251.   ERRCODE_REQOPTPARAM           = 1;      { Required optional parameter missing }
  4252.   ERRCODE_INVALIDOPTPARAM       = 2;      { Optional param out-of-range or bad }
  4253.  
  4254.  
  4255.   DBIERR_REQOPTPARAM            = (ERRBASE_OPTPARAM + ERRCODE_REQOPTPARAM);
  4256.   DBIERR_INVALIDOPTPARAM        = (ERRBASE_OPTPARAM + ERRCODE_INVALIDOPTPARAM);
  4257.  
  4258. {  ERRCAT_REPOSITORY }
  4259. {  ================= }
  4260.  
  4261.   ERRCODE_REPOSITORYCORRUPT     = 1;    { Data Repository is corrupt }
  4262.   ERRCODE_INFOBLOBCORRUPT       = 2;    { Info Blob corrupted }
  4263.   ERRCODE_SCHEMACORRUPT         = 3;    { DR Schema is corrupt }
  4264.   ERRCODE_ATTRTYPEEXISTS        = 4;    { Attribute Type exists }
  4265.   ERRCODE_INVALIDOBJTYPE        = 5;    { Invalid Object Type }
  4266.   ERRCODE_INVALIDRELATIONTYPE   = 6;    { Invalid Relation Type }
  4267.   ERRCODE_VIEWEXISTS            = 7;    { View already exists }
  4268.   ERRCODE_NOSUCHVIEW            = 8;    { No such View exists }
  4269.   ERRCODE_INVALIDRECCONSTRAINT  = 9;    { Invalid Record Constraint }
  4270.   ERRCODE_LDBCONNECTION         = 10;   { Object is in a Logical DB }
  4271.   ERRCODE_REPOSITORYEXISTS      = 11;   { Repository already exists }
  4272.   ERRCODE_NOSUCHREPOSITORY      = 12;   { Repository does not exist }
  4273.   ERRCODE_REPOSITORYDBMISSING   = 13;   { Repository database does not exist }
  4274.   ERRCODE_REPOSITORYOUTOFDATE   = 14;   { Repository info is out of date }
  4275.   ERRCODE_REPOSITORYVERSION     = 15;   { DR Version mismatch }
  4276.   ERRCODE_REPOSITORYNAME        = 16;   { Invalid Repository name }
  4277.   ERRCODE_DEPENDENTOBJECTS      = 17;   { Dependent Objects exist }
  4278.   ERRCODE_RELATIONLIMIT         = 18;   { Too many Relationships for this Object Type }
  4279.   ERRCODE_RELATIONSHIPSEXIST    = 19;   { Relationships to the Object exist }
  4280.   ERRCODE_EXCHANGEFILECORRUPT   = 20;   { Exchange File Corrupt }
  4281.   ERRCODE_EXCHANGEFILEVERSION   = 21;   { Exchange File Version Mismatch }
  4282.   ERRCODE_TYPEMISMATCH          = 22;   { Exchange File and Repository Types don't match }
  4283.   ERRCODE_OBJECTEXISTS          = 23;   { Object Exists in the Target Repository }
  4284.   ERRCODE_REPOSITORYACCESS      = 24;   { Access to Repository Denied }
  4285.   ERRCODE_REPOSITORYCREATE      = 25;   { Cannot Create Repository }
  4286.   ERRCODE_DATABASEOPENFAILED    = 26;   { Cannot Open a Database }
  4287.  
  4288.  
  4289.   DBIERR_REPOSITORYCORRUPT      = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYCORRUPT);
  4290.   DBIERR_INFOBLOBCORRUPT        = (ERRBASE_REPOSITORY + ERRCODE_INFOBLOBCORRUPT);
  4291.   DBIERR_SCHEMACORRUPT          = (ERRBASE_REPOSITORY + ERRCODE_SCHEMACORRUPT);
  4292.   DBIERR_ATTRTYPEEXISTS         = (ERRBASE_REPOSITORY + ERRCODE_ATTRTYPEEXISTS);
  4293.   DBIERR_INVALIDOBJTYPE         = (ERRBASE_REPOSITORY + ERRCODE_INVALIDOBJTYPE);
  4294.   DBIERR_INVALIDRELATIONTYPE    = (ERRBASE_REPOSITORY + ERRCODE_INVALIDRELATIONTYPE);
  4295.   DBIERR_VIEWEXISTS             = (ERRBASE_REPOSITORY + ERRCODE_VIEWEXISTS);
  4296.   DBIERR_NOSUCHVIEW             = (ERRBASE_REPOSITORY + ERRCODE_NOSUCHVIEW);
  4297.   DBIERR_INVALIDRECCONSTRAINT   = (ERRBASE_REPOSITORY + ERRCODE_INVALIDRECCONSTRAINT);
  4298.   DBIERR_LDBCONNECTION          = (ERRBASE_REPOSITORY + ERRCODE_LDBCONNECTION);
  4299.   DBIERR_REPOSITORYEXISTS       = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYEXISTS);
  4300.   DBIERR_NOSUCHREPOSITORY       = (ERRBASE_REPOSITORY + ERRCODE_NOSUCHREPOSITORY);
  4301.   DBIERR_REPOSITORYDBMISSING    = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYDBMISSING);
  4302.   DBIERR_REPOSITORYOUTOFDATE    = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYOUTOFDATE);
  4303.   DBIERR_REPOSITORYVERSION      = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYVERSION);
  4304.   DBIERR_REPOSITORYNAME         = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYNAME);
  4305.   DBIERR_DEPENDENTOBJECTS       = (ERRBASE_REPOSITORY + ERRCODE_DEPENDENTOBJECTS);
  4306.   DBIERR_RELATIONLIMIT          = (ERRBASE_REPOSITORY + ERRCODE_RELATIONLIMIT);
  4307.   DBIERR_RELATIONSHIPSEXIST     = (ERRBASE_REPOSITORY + ERRCODE_RELATIONSHIPSEXIST);
  4308.   DBIERR_EXCHANGEFILECORRUPT    = (ERRBASE_REPOSITORY + ERRCODE_EXCHANGEFILECORRUPT);
  4309.   DBIERR_EXCHANGEFILEVERSION    = (ERRBASE_REPOSITORY + ERRCODE_EXCHANGEFILEVERSION);
  4310.   DBIERR_TYPEMISMATCH           = (ERRBASE_REPOSITORY + ERRCODE_TYPEMISMATCH);
  4311.   DBIERR_OBJECTEXISTS           = (ERRBASE_REPOSITORY + ERRCODE_OBJECTEXISTS);
  4312.   DBIERR_REPOSITORYACCESS       = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYACCESS);
  4313.   DBIERR_REPOSITORYCREATE       = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYCREATE);
  4314.   DBIERR_DATABASEOPENFAILED     = (ERRBASE_REPOSITORY + ERRCODE_DATABASEOPENFAILED);
  4315.  
  4316. {============================================================================}
  4317. {                          DBI prototypes                                    }
  4318. {============================================================================}
  4319. {                          Environmental                                     }
  4320. {----------------------------------------------------------------------------}
  4321.  
  4322. function DbiInitFn (                    { Initialize the Engine }
  4323.       iVer          : Word;             { Interface Version }
  4324.       pEnv          : pDBIEnv           { Environment Structure/NULL }
  4325.    ): DBIResult stdcall;
  4326.  
  4327.  { DO NOT CALL THIS DIRECTLY. Use the 'DbiInit' define below. }
  4328.  
  4329.  { Initializes the engine environment. Default settings can be overwritten  }
  4330.  { by supplying the appropriate settings. Defaults are read from the system }
  4331.  { configuration file. pEnv can be NULLP to get the system defautls.        }
  4332.  
  4333. function DbiInit (pEnv: PDbiEnv): DBIResult stdcall;
  4334.  
  4335. function DbiExit: DBIResult stdcall;            { Exit engine }
  4336.  
  4337. function DbiDLLExit: DBIResult stdcall;         { Exit DLL }
  4338.  
  4339. {============================================================================}
  4340. {                         System Level Info                                  }
  4341. {============================================================================}
  4342.  
  4343. function DbiGetSysVersion (             { Get system version info }
  4344. var   sysVersion    : SYSVersion
  4345.    ): DBIResult stdcall;
  4346.  
  4347. function DbiGetSysConfig (              { System configuration }
  4348. var   sysConfig     : SYSConfig
  4349.    ): DBIResult stdcall;
  4350.  
  4351. function DbiGetClientInfo (             { Get Client info }
  4352. var   clientInfo    : CLIENTInfo
  4353.    ): DBIResult stdcall;
  4354.  
  4355. function DbiGetSysInfo (                { Get system status/info }
  4356. var   sysInfo       : SYSInfo
  4357.    ): DBIResult stdcall;
  4358.  
  4359. function DbiLoadDriver (                { Load a given driver }
  4360.       pszDriverType : PChar             { Driver name }
  4361.    ): DBIResult stdcall;
  4362.  
  4363. {============================================================================}
  4364. {                            Sessions                                        }
  4365. {============================================================================}
  4366.  
  4367. function DbiStartSession (              { Start a new session }
  4368.       pszName       : PChar;            { Name (Optional) }
  4369. var   hSes          : hDBISes;          { Session }
  4370.       pNetDir       : PChar             { Netfile directory for session (opt) }
  4371.    ): DBIResult stdcall;
  4372.  
  4373. function DbiGetCurrSession (            { Get the current session }
  4374. var   hSes          : hDBISes           { Session }
  4375.    ): DBIResult stdcall;
  4376.  
  4377. function DbiSetCurrSession (            { Set the current session }
  4378.       hSes          : hDBISes           { Session/NULL }
  4379.    ): DBIResult stdcall;
  4380.  
  4381. function DbiCloseSession (              { Close the current session }
  4382.       hSes          : hDBISes           { Session }
  4383.    ): DBIResult stdcall;
  4384.  
  4385. function DbiGetSesInfo (                { Get current session info }
  4386. var   sesInfo       : SESInfo
  4387.    ): DBIResult stdcall;
  4388.  
  4389. function DbiSetPrivateDir (             { Set Private Directory for session }
  4390.       pszDir        : PChar             { Directory name/NULL }
  4391.    ): DBIResult stdcall;
  4392.  
  4393.  
  4394. {============================================================================}
  4395. {                     Datababase, Schema and File inquiry                    }
  4396. {============================================================================}
  4397.  
  4398. function DbiOpenDatabase (              { Open a database }
  4399.       pszDbName     : PChar;            { Database name }
  4400.       pszDbType     : PChar;            { Database type (NULL: Universal) }
  4401.       eOpenMode     : DBIOpenMode;      { Open type }
  4402.       eShareMode    : DBIShareMode;     { Share type }
  4403.       pszPassword   : PChar;            { Password }
  4404.       iOptFlds      : Word;             { Number of optional Params }
  4405.       pOptFldDesc   : pFLDDesc;         { Optional Field Descriptors }
  4406.       pOptParams    : Pointer;          { Optional Params }
  4407. var   hDb           : hDBIDb            { Returnd database handle }
  4408.    ): DBIResult stdcall;
  4409.  
  4410. function DbiSetDirectory (              { Set the current directory }
  4411.       hDb           : hDBIDb;           { Universal database handle }
  4412.       pszDir        : PChar             { Directory/NULL }
  4413.    ): DBIResult stdcall;
  4414.  
  4415. function DbiGetDirectory (              { Get the current/default directory }
  4416.       hDb           : hDBIDb;           { Universal database handle }
  4417.       bDefault      : Bool;             { True for default }
  4418.       pszDir        : PChar             { Returned directory }
  4419.    ): DBIResult stdcall;
  4420.  
  4421. function DbiOpenTableList (             { Open a cursor on "Tables" }
  4422.       hDb           : hDBIDb;           { Database handle }
  4423.       bExtended     : Bool;             { True for extended info }
  4424.       bSystem       : Bool;             { True to include system tables }
  4425.       pszWild       : PChar;            { Wild card name }
  4426. var   hCur          : hDBICur           { Returned cursor }
  4427.    ): DBIResult stdcall;
  4428.  
  4429. function DbiOpenFileList (              { Open a cursor on "Files" }
  4430.       hDb           : hDBIDb;           { Universal database handle }
  4431.       pszWild       : PChar;            { Wild card name }
  4432. var   hCur          : hDBICur           { Returned cursor }
  4433.    ): DBIResult stdcall;
  4434.  
  4435. function DbiOpenIndexList (             { Return "Indexes" for a table }
  4436.       hDb           : hDBIDb;           { Database handle }
  4437.       pszTableName  : PChar;            { Table name }
  4438.       pszDriverType : PChar;            { Driver type }
  4439. var   hCur          : hDBICur           { Returned cursor on "Indexes" }
  4440.    ): DBIResult stdcall;
  4441.  
  4442. function DbiOpenFieldList (             { Return "Fields" for a table }
  4443.       hDb           : hDBIDb;           { Database handle }
  4444.       pszTableName  : PChar;            { Table name }
  4445.       pszDriverType : PChar;            { Driver type }
  4446.       bPhyTypes     : Bool;             { True, for physical types }
  4447. var   hCur          : hDBICur           { Returned cursor on "Fields" }
  4448.    ): DBIResult stdcall;
  4449.  
  4450. function DbiOpenVchkList (              { Return "Checks" for a table }
  4451.       hDb           : hDBIDb;           { Database handle }
  4452.       pszTableName  : PChar;            { Table name }
  4453.       pszDriverType : PChar;            { Driver Type }
  4454. var   hChkCur       : hDBICur           { Returned cursor on "Checks" }
  4455.    ): DBIResult stdcall;
  4456.  
  4457. function DbiOpenRintList (              { Return Integrity checks }
  4458.       hDb           : hDBIDb;           { Database handle }
  4459.       pszTableName  : PChar;            { Table name }
  4460.       pszDriverType : PChar;            { Driver type }
  4461. var   hChkCur       : hDBICur           { Returned cursor on "Ref Int". }
  4462.    ): DBIResult stdcall;
  4463.  
  4464. function DbiOpenSecurityList (          { Return security descriptions }
  4465.       hDb           : hDBIDb;           { Database handle }
  4466.       pszTableName  : PChar;            { Table name }
  4467.       pszDriverType : PChar;            { Driver type }
  4468. var   hSecCur       : hDBICur           { Returned cursor on sec list }
  4469.    ): DBIResult stdcall;
  4470.  
  4471. function DbiOpenFamilyList (            { Return family members }
  4472.       hDb           : hDBIDb;           { Database handle }
  4473.       pszTableName  : PChar;            { Table name }
  4474.       pszDriverType : PChar;            { Driver type }
  4475. var   hFmlCur       : hDBICur           { Returned cursor on "Family" }
  4476.    ): DBIResult stdcall;
  4477.  
  4478. function DbiOpenSPList (                { Open a cursor on "Stored Procedures" }
  4479.       hDb           : hDBIDb;           { Universal database handle }
  4480.       bExtended     : Bool;             { True for extended info (N/A) }
  4481.       bSystem       : Bool;             { True to include system procedures }
  4482.       pszQual       : PChar;            { Qualifier (N/A) }
  4483. var   hCur          : hDBICur           { Returned cursor }
  4484.    ): DBIResult stdcall;
  4485.  
  4486. function DbiOpenSPParamList (           { Return "Parameters" for a stored procedure }
  4487.       hDb           : hDBIDb;           { Database handle }
  4488.       pszSPName     : PChar;            { Stored procedure name }
  4489.       bPhyTypes     : Bool;             { True, for physical types }
  4490.       uOverload     : Word;             { Overload number }
  4491. var   hCur          : hDBICur           { Returned cursor on "Parameters" }
  4492.    ): DBIResult stdcall;
  4493.  
  4494. function DbiOpenFunctionList (          { Open a cursor on "Functions" }
  4495.       hDb           : hDBIDb;           { Universal database handle }
  4496.       eoptBits      : DBIFUNCOpts;      { Options for function list }
  4497.       phCur         : phDBICur          { Returned cursor on "Functions" }
  4498.                                         { Record desc is of type DBIFUNCDesc }
  4499.    ): DBIResult stdcall;
  4500.  
  4501. function DbiOpenFunctionArgList (       { Return "Arguments" for a function }
  4502.       hDb           : hDBIDb;           { Database handle }
  4503.       pszFuncName   : PChar;            { Function name }
  4504.       uOverload     : Word;             { Overload number }
  4505.       phCur         : phDBICur          { Returned cursor on "Arguments" }
  4506.    ): DBIResult stdcall;
  4507.  
  4508. function DbiCloseDatabase (             { Close a database }
  4509. var   hDb           : hDBIDb            { Pointer to database handle }
  4510.    ): DBIResult stdcall;
  4511.  
  4512. {============================================================================}
  4513. {                                  Capabilities                              }
  4514. {============================================================================}
  4515.  
  4516. function DbiOpenDriverList (            { Get a list of driver names }
  4517. var   hCur          : hDBICur           { Returned cursor }
  4518.    ): DBIResult stdcall;
  4519.  
  4520. function DbiGetDriverDesc (             { Get description for a given type }
  4521.       pszDriverType : PChar;            { Symbolic name for driver type }
  4522. var   drvType       : DRVType           { Driver type description }
  4523.    ): DBIResult stdcall;
  4524.  
  4525. function DbiOpenDatabaseList (          { Get a list of registered databases }
  4526. var   hCur          : hDBICur           { Returned cursor }
  4527.    ): DBIResult stdcall;
  4528.  
  4529. function DbiGetDatabaseDesc (           { Get a description of a logical db }
  4530.       pszName       : PChar;            { Name of logical database }
  4531.       pdbDesc       : pDBDesc           { Database description }
  4532.    ): DBIResult stdcall;
  4533.  
  4534. function DbiOpenTableTypesList (        { Get a list of table types }
  4535.       pszDriverType : PChar;            { Driver type }
  4536. var   hCur          : hDBICur           { Returned cursor }
  4537.    ): DBIResult stdcall;
  4538.  
  4539. function DbiGetTableTypeDesc (          { Get Table capabilities }
  4540.       pszDriverType : PChar;            { Driver type }
  4541.       pszTableType  : PChar;            { Table type }
  4542. var   tblType       : TBLType           { Table Capabilities }
  4543.    ): DBIResult stdcall;
  4544.  
  4545.  
  4546. function DbiOpenFieldTypesList (        { Get a list of field types }
  4547.       pszDriverType : PChar;            { Driver type }
  4548.       pszTblType    : PChar;            { Table type (Optional) }
  4549. var   hCur          : hDBICur           { Returned cursor }
  4550.    ): DBIResult stdcall;
  4551.  
  4552. function DbiGetFieldTypeDesc (          { Get list of field types }
  4553.       pszDriverType : PChar;            { Driver type }
  4554.       pszTableType  : PChar;            { Table type }
  4555.       pszFieldType  : PChar;            { Field type  (Physical only) }
  4556. var   fldType       : FLDType           { Field type description }
  4557.    ): DBIResult stdcall;
  4558.  
  4559. function DbiOpenIndexTypesList (        { Get list of index types }
  4560.       pszDriverType : PChar;            { Driver type }
  4561. var   hCur          : hDBICur           { Returned cursor }
  4562.    ): DBIResult stdcall;
  4563.  
  4564. function DbiGetIndexTypeDesc (          { Get description of given idx type }
  4565.       pszDriverType : PChar;            { Driver type }
  4566.       pszIndexType  : PChar;            { Index type }
  4567. var   idxType       : IDXType           { Index description }
  4568.    ): DBIResult stdcall;
  4569.  
  4570. function DbiOpenLdList (                { Get a list of Lang Drivers }
  4571. var   hCur          : hDBICur           { Returned cursor }
  4572.    ): DBIResult stdcall;
  4573.  
  4574. {===========================================================================}
  4575. {                      Table Open, Properties & Structure                   }
  4576. {===========================================================================}
  4577.  
  4578. function DbiOpenTable (                 { Open a table }
  4579.       hDb           : hDBIDb;           { Database handle }
  4580.       pszTableName  : PChar;            { Table name or file name }
  4581.       pszDriverType : PChar;            { Driver type                 /NULL }
  4582.       pszIndexName  : PChar;            { Index to be used for access /NULL }
  4583.       pszIndexTagName : PChar;          { Index tag name              /NULL }
  4584.       iIndexId      : Word;             { Index number                /0 }
  4585.       eOpenMode     : DBIOpenMode;      { Read or RW }
  4586.       eShareMode    : DBIShareMode;     { Excl or Share }
  4587.       exltMode      : XLTMode;          { Xlate mode }
  4588.       bUniDirectional : Bool;           { Uni or Bi directional }
  4589.       pOptParams    : Pointer;          { Optional params /NULL }
  4590. var   hCursor       : hDBICur           { Returns Cursor handle }
  4591.    ): DBIResult stdcall;
  4592.  
  4593. function DbiOpenNestedTable(            { Get nested table }
  4594.       hCursor       : hDBICur;          { Master cursor }
  4595.       iFieldNo      : Word;             { FieldID of nested table field }
  4596.       bReadOnly     : Bool;             { if TRUE, read only mode }
  4597.       bUniDirectional: Bool;            { if TRUE, unidirectional }
  4598. var   hCursorNested : hDBICur           { Returns Cursor handle for nested table }
  4599.    ): DBIResult; stdcall;
  4600.  
  4601. function DbiOpenRef(
  4602.       hCursor       : hDBICur;          { Master cursor }
  4603.       iFieldNo      : Word;             { FieldID }
  4604.       bReadOnly     : Bool;             { if TRUE, read only mode }
  4605.       bUniDirectional: Bool;            { If TRUE, Uni directional }
  4606. var   hRefCursor    : hDBICur           { Returns Cursor handle for REF }
  4607.    ): DBIResult; stdcall;
  4608.  
  4609. function DbiDatabaseFlush(
  4610.       hDb              : hDBIDb         { database handle }
  4611. ): DBIResult;
  4612.  
  4613. function DbiGetCursorProps (            { Get Cursor properties }
  4614.       hCursor       : hDBICur;          { Cursor handle }
  4615. var   curProps      : CURProps          { Cursor properties }
  4616.    ): DBIResult stdcall;
  4617.  
  4618. function DbiGetObjFromName (            { Get object from name }
  4619.       eObjType      : DBIOBJType;       { Object handle }
  4620.       pszObjName    : PChar;            { Name of object /NULL }
  4621. var   hObj          : hDBIObj           { Returned object handle }
  4622.    ): DBIResult stdcall;
  4623.  
  4624. function DbiGetObjFromObj (             { Get associated object }
  4625.       hObj          : hDBIObj;          { Object handle }
  4626.       eObjType      : DBIOBJType;       { Type of associated object }
  4627. var   hObjOut       : hDBIObj           { Returns object of eObjType }
  4628.    ): DBIResult stdcall;
  4629.  
  4630. function DbiGetProp (                   { Get property }
  4631.       hObj          : hDBIObj;          { Object handle }
  4632.       iProp         : Longint;          { Property to retrieve }
  4633.       PropValue     : Pointer;          { == NULL, validate iProp for getting }
  4634.       iMaxLen       : Word;             { Length of buffer pPropValue }
  4635. var   iLen          : Word              { Returns required length }
  4636.    ): DBIResult stdcall;
  4637.  
  4638. function DbiSetProp (                   { Set property }
  4639.       hObj          : hDBIObj;          { Object handle }
  4640.       iProp         : Longint;          { Property to set }
  4641.       iPropValue    : Longint           { Property value }
  4642.    ): DBIResult stdcall;
  4643.  
  4644. function DbiValidateProp (              { Validate a property }
  4645.       hObj          : hDBIObj;          { Object handle }
  4646.       iProp         : Longint;          { property to validate }
  4647.       bSetting      : Bool              { TRUE:setting, FALSE:getting }
  4648.    ): DBIResult stdcall;
  4649.  
  4650. function DbiGetFieldDescs (             { Get field descriptions }
  4651.       hCursor       : hDBICur;          { Cursor handle }
  4652.       pfldDesc      : pFLDDesc          { Array of field descriptors }
  4653.    ): DBIResult stdcall;
  4654.  
  4655. function DbiGetCursorForTable (         { Find cursor for a given table }
  4656.       hDb           : hDBIDb;           { Database handle }
  4657.       pszTableName  : PChar;            { Table name }
  4658.       pszDriverType : PChar;            { Driver type / NULL }
  4659. var   hCursor       : hDBICur           { Returned cursor }
  4660.    ): DBIResult stdcall;
  4661.  
  4662. function DbiCloneCursor (               { Return a duplicate cursor }
  4663.       hCurSrc       : hDBICur;          { Source cursor }
  4664.       bReadOnly     : Bool;             { If TRUE, read only mode }
  4665.       bUniDirectional : Bool;           { If TRUE, Uni directional }
  4666. var   hCurNew       : hDBICur           { Destination cursor address }
  4667.    ): DBIResult stdcall;
  4668.  
  4669. function DbiCloseCursor (               { Closes cursor }
  4670. var   hCursor       : hDBICur           { Pntr to Cursor handle }
  4671.    ): DBIResult stdcall;
  4672.  
  4673.  
  4674. {============================================================================}
  4675. {                      Index Manipulation & Usage                            }
  4676. {============================================================================}
  4677.  
  4678. function DbiOpenIndex (                 { Open an index }
  4679.       hCursor       : hDBICur;          { Cursor handle }
  4680.       pszIndexName  : PChar;            { Index Name }
  4681.       iIndexId      : Word              { Index number (if applicable) }
  4682.    ): DBIResult stdcall;
  4683.  
  4684. function DbiCloseIndex (                { Close an index }
  4685.       hCursor       : hDBICur;          { Cursor handle }
  4686.       pszIndexName  : PChar;            { Index Name }
  4687.       iIndexId      : Word              { Index number }
  4688.    ): DBIResult stdcall;
  4689.  
  4690. function DbiSwitchToIndex (             { Change index order of access }
  4691. var   hCursor       : hDBICur;          { Cursor handle (In/Out) }
  4692.       pszIndexName  : PChar;            { Index name }
  4693.       pszTagName    : PChar;            { Tag name (if applicable) }
  4694.       iIndexId      : Word;             { Index number }
  4695.       bCurrRec      : Bool              { Position at current rec }
  4696.    ): DBIResult stdcall;
  4697.  
  4698. function DbiGetIndexDesc (              { Get index properties }
  4699.       hCursor       : hDBICur;          { Cursor handle }
  4700.       iIndexSeqNo   : Word;             { Index number }
  4701. var   idxDesc       : IDXDesc           { Returned index description }
  4702.    ): DBIResult stdcall;
  4703.  
  4704. function DbiGetIndexDescs (             { Get index properties }
  4705.       hCursor       : hDBICur;          { Cursor handle }
  4706.       idxDesc       : PIDXDesc          { Returned index descriptors }
  4707.    ): DBIResult stdcall;
  4708.  
  4709. function DbiGetIndexForField (          { Get index desc for given field }
  4710.       hCursor       : hDBICur;          { Cursor handle }
  4711.       iFld          : Word;             { Field Number (1..N) }
  4712.       bProdTagOnly  : Bool;             { If TRUE, only xBASE prod tags will be returned }
  4713. var   idxDesc       : IDXDesc           { (Optional) }
  4714.    ): DBIResult stdcall;
  4715.  
  4716. function DbiGetIndexSeqNo (             { Get index sequence number }
  4717.       hCursor       : hDBICur;          { Cursor handle }
  4718.       pszIndexName  : PChar;            { Index name }
  4719.       pszTagName    : PChar;            { Tag name (if applicable) }
  4720.       iIndexId      : Word;             { Index number }
  4721. var   iIndexSeqNo   : Word              { Index number }
  4722.    ): DBIResult stdcall;
  4723.  
  4724. function DbiSetToKey (                  { Set key condition }
  4725.       hCursor       : hDBICur;          { Cursor handle }
  4726.       eSearchCond   : DBISearchCond;    { Search condition (default is =) }
  4727.       bDirectKey    : Bool;             { Key is supplied directly }
  4728.       iFields       : Word;             { No of full fields to match }
  4729.       iLen          : Word;             { Partial key len of last field }
  4730.       pBuff         : Pointer           { Either Record buffer or Key itself }
  4731.    ): DBIResult stdcall;
  4732.  
  4733. function DbiExtractKey (                { Get the key value of current record }
  4734.       hCursor       : hDBICur;          { Cursor handle }
  4735.       pRecBuf       : Pointer;          { Record buffer (optional) }
  4736.       pKeyBuf       : Pointer           { Returned. Key bytes. }
  4737.    ): DBIResult stdcall;
  4738.  
  4739. function DbiSetRange (                  { Set cursor to a range }
  4740.       hCursor       : hDBICur;          { Cursor }
  4741.       bKeyItself    : Bool;             { Whether Key or Record buffer }
  4742.       iFields1      : Word;             { Key fields to be mathced in full }
  4743.       iLen1         : Word;             { Key length to compare }
  4744.       pKey1         : Pointer;          { Top/Left key in Range }
  4745.       bKey1Incl     : Bool;             { If Inclusive of Key1 }
  4746.       iFields2      : Word;             { Key fields to be mathced in full }
  4747.       iLen2         : Word;             { Key length to compare }
  4748.       pKey2         : Pointer;          { Bottom/Right key in Range }
  4749.       bKey2Incl     : Bool              { If Inclusive of Key2 }
  4750.    ): DBIResult stdcall;
  4751.  
  4752. function DbiResetRange (                { Reset range }
  4753.       hCursor       : hDBICur           { cursor handle }
  4754.    ): DBIResult stdcall;
  4755.  
  4756. function DbiCompareKeys (               { Compare two keys }
  4757.       hCursor       : hDBICur;          { Cursor handle }
  4758.       pKey1         : Pointer;          { Key buffer 1 to compare }
  4759.       pKey2         : Pointer;          { Key buffer 2 (Or NULL) }
  4760.       iFields       : Word;             { Fields to compare in full }
  4761.       iLen          : Word;             { Partial key to compare }
  4762. var   iResult       : SmallInt          { Compare result }
  4763.    ): DBIResult stdcall;
  4764.  
  4765. function DbiGetRecordForKey (           { Find a record matching key }
  4766.       hCursor       : hDBICur;          { Cursor handle }
  4767.       bDirectKey    : Bool;             { Key is supplied directly }
  4768.       iFields       : Word;             { No of full fields to match }
  4769.       iLen          : Word;             { Partial key len of last field }
  4770.       pKey          : Pointer;          { Either Record buffer or Key itself }
  4771.       pRecBuff      : Pointer           { (Optional) Record buffer }
  4772.    ): DBIResult stdcall;
  4773.  
  4774. {=============================================================================}
  4775. {                          Validity check and referential integrity           }
  4776. {=============================================================================}
  4777.  
  4778. function DbiGetVchkDesc (               { Get valcheck descriptor }
  4779.       hCursor       : hDBICur;          { Cursor handle }
  4780.       iValSeqNo     : Word;             { Valcheck sequence number }
  4781.       pvalDesc      : pVCHKDesc         { Returned valcheck description }
  4782.    ): DBIResult stdcall;
  4783.  
  4784. function DbiGetRintDesc (               { Get referential integrity descriptor }
  4785.       hCursor       : hDBICur;          { Cursor handle }
  4786.       iRintSeqNo    : Word;             { Rint sequence number }
  4787.       printDesc     : pRINTDesc         { Returned rint description }
  4788.    ): DBIResult stdcall;
  4789.  
  4790. {=============================================================================}
  4791. {                              Cursor Maintenance                             }
  4792. {=============================================================================}
  4793.  
  4794.  
  4795. function DbiSetToBegin (                { Reset cursor to beginning }
  4796.       hCursor       : hDBICur           { Cursor handle }
  4797.    ): DBIResult stdcall;
  4798.  
  4799. function DbiSetToEnd (                  { Reset cursor to ending }
  4800.       hCursor       : hDBICur           { Cursor handle }
  4801.    ): DBIResult stdcall;
  4802.  
  4803. function DbiSetToCursor (               { Set cursor to another cursor position }
  4804.       hDest         : hDBICur;          { Destination cursor }
  4805.       hSrc          : hDBICur           { Source cursor }
  4806.    ): DBIResult stdcall;
  4807.  
  4808. function DbiGetBookMark (               { Get a book-mark }
  4809.       hCur          : hDBICur;          { Cursor }
  4810.       pBookMark     : Pointer           { Pointer to Book-Mark }
  4811.    ): DBIResult stdcall;
  4812.  
  4813. function DbiSetToBookMark (             { Position to a Book-Mark }
  4814.       hCur          : hDBICur;          { Cursor }
  4815.       pBookMark     : Pointer           { Pointer to Book-Mark }
  4816.    ): DBIResult stdcall;
  4817.  
  4818. function DbiCompareBookMarks (          { Compare two Book-marks }
  4819.       hCur          : hDBICur;          { Cursor }
  4820.       pBookMark1    : Pointer;          { Book mark 1 }
  4821.       pBookMark2    : Pointer;          { Book mark 2 }
  4822. var   CmpBkmkResult : CmpBkmkRslt       { Compare result }
  4823.    ): DBIResult stdcall;
  4824.  
  4825. {============================================================================}
  4826. {                      Data Access: Logical Record Level                     }
  4827. {============================================================================}
  4828.  
  4829.  
  4830. function DbiGetNextRecord (             { Find/Get the next record }
  4831.       hCursor       : hDBICur;          { Cursor handle }
  4832.       eLock         : DBILockType;      { Optional lock request }
  4833.       pRecBuff      : Pointer;          { Record buffer(client) }
  4834.       precProps     : pRECProps         { Optional record properties }
  4835.    ): DBIResult stdcall;
  4836.  
  4837. function DbiGetPriorRecord (            { Find/Get the prior record }
  4838.       hCursor       : hDBICur;          { Cursor handle }
  4839.       eLock         : DBILockType;      { Optional lock request }
  4840.       pRecBuff      : Pointer;          { Record buffer (client) }
  4841.       precProps     : pRECProps         { Optional record properties }
  4842.    ): DBIResult stdcall;
  4843.  
  4844. function DbiGetRecord (                 { Gets the current record }
  4845.       hCursor       : hDBICur;          { Cursor handle }
  4846.       eLock         : DBILockType;      { Optional lock request }
  4847.       pRecBuff      : Pointer;          { Record buffer(client) }
  4848.       precProps     : pRECProps         { Optional record properties }
  4849.    ): DBIResult stdcall;
  4850.  
  4851. function DbiGetRelativeRecord (         { Find/Get a record by record number }
  4852.       hCursor       : hDBICur;          { Cursor handle }
  4853.       iPosOffset    : Longint;          { offset from current position }
  4854.       eLock         : DBILockType;      { Optional lock request }
  4855.       pRecBuff      : Pointer;          { Record buffer(client) }
  4856.       precProps     : pRECProps         { Optional record properties }
  4857.    ): DBIResult stdcall;
  4858.  
  4859. function DbiInitRecord (                { Initialize record area }
  4860.       hCursor       : hDBICur;          { Cursor handle }
  4861.       pRecBuff      : Pointer           { Record buffer }
  4862.    ): DBIResult stdcall;
  4863.  
  4864. function DbiInsertRecord (              { Inserts a new record }
  4865.       hCursor       : hDBICur;          { Cursor handle }
  4866.       eLock         : DBILockType;      { Optional lock on this rec }
  4867.       pRecBuff      : Pointer           { New Record (client) }
  4868.    ): DBIResult stdcall;
  4869.  
  4870. function DbiModifyRecord (              { Updates the current record }
  4871.       hCursor       : hDBICur;          { Cursor handle }
  4872.       pRecBuf       : Pointer;          { Modified record }
  4873.       bFreeLock     : Bool              { Free record lock }
  4874.    ): DBIResult stdcall;
  4875.  
  4876. function DbiDeleteRecord (              { Deletes the current record }
  4877.       hCursor       : hDBICur;          { Cursor handle }
  4878.       pRecBuf       : Pointer           { Copy of deleted record }
  4879.    ): DBIResult stdcall;
  4880.  
  4881. function DbiReadBlock (                 { Read a block of records }
  4882.       hCursor       : hDBICur;          { Cursor handle }
  4883. var   iRecords      : Longint;          { Number of records to read }
  4884.       pBuf          : Pointer           { Buffer }
  4885.    ): DBIResult stdcall;
  4886.  
  4887. function DbiWriteBlock (                { Write a block of records }
  4888.       hCursor       : hDBICur;          { Cursor handle }
  4889. var   iRecords      : Longint;          { Number of records to write/written }
  4890.       pBuf          : Pointer           { Buffer }
  4891.    ): DBIResult stdcall;
  4892.  
  4893. function DbiAppendRecord (              { Inserts a new record }
  4894.       hCursor       : hDBICur;          { Cursor handle }
  4895.       pRecBuff      : Pointer           { New Record (client) }
  4896.    ): DBIResult stdcall;
  4897.  
  4898. function DbiUndeleteRecord (            { Undeletes the current record }
  4899.       hCursor       : hDBICur           { Cursor handle }
  4900.    ): DBIResult stdcall;
  4901.  
  4902. function DbiGetSeqNo (                  { Get logical record number }
  4903.       hCursor       : hDBICur;          { Cursor handle }
  4904. var   iSeqNo        : Longint           { Pointer to sequence number }
  4905.    ): DBIResult stdcall;
  4906.  
  4907. function DbiSetToSeqNo (                { Position to a logical record number }
  4908.       hCursor       : hDBICur;          { Cursor handle }
  4909.       iSeqNo        : Longint           { Sequence number }
  4910.    ): DBIResult stdcall;
  4911.  
  4912. function DbiGetRecordCount (            { Get the current number of records }
  4913.       hCursor       : hDBICur;          { Cursor handle }
  4914. var   iRecCount     : Longint           { Number of records }
  4915.    ): DBIResult stdcall;
  4916.  
  4917.  
  4918. function DbiGetExactRecordCount (       { Get the exact number of records }
  4919.       hCursor       : hDBICur;          { Cursor handle }
  4920. var   iRecCount     : Longint           { Number of records }
  4921.    ): DBIResult stdcall;
  4922.  
  4923.  
  4924. function DbiSetToRecordNo (             { Position to Physical Rec# }
  4925.       hCursor       : hDBICur;          { Cursor handle }
  4926.       iRecNo        : Longint           { Physical record number }
  4927.    ): DBIResult stdcall;
  4928.  
  4929. function DbiSaveChanges (               { Flush all buffered changes }
  4930.       hCursor       : hDBICur           { Cursor handle }
  4931.    ): DBIResult stdcall;
  4932.  
  4933. function DbiForceReread (               { Force Reread of buffers from Disk }
  4934.       hCursor       : hDBICur           { Cursor }
  4935.    ): DBIResult stdcall;
  4936.  
  4937. function DbiCheckRefresh: DBIResult stdcall;    { Check refresh for session }
  4938.  
  4939. function DbiMakePermanent (             { Make temporary table permanent }
  4940.       hCursor       : hDBICur;          { Cursor handle }
  4941.       pszName       : PChar;            { Rename temporary table }
  4942.       bOverWrite    : Bool              { Overwrite existing file }
  4943.    ): DBIResult stdcall;
  4944.  
  4945. function DbiForceRecordReread (         { Force Reread of current record from Server }
  4946.       hCursor       : hDBICur;          { Cursor handle }
  4947.       pRecBuff      : Pointer           { Returned : record buffer }
  4948.    ): DBIResult stdcall;
  4949.  
  4950. {============================================================================}
  4951. {                            Field Level Access                              }
  4952. {============================================================================}
  4953.  
  4954. function DbiGetField (                  { Get Field value }
  4955.       hCursor       : hDBICur;          { Cursor }
  4956.       iField        : Word;             { Field # (1..n) }
  4957.       pRecBuff      : Pointer;          { Record buffer }
  4958.       pDest         : Pointer;          { Destination field buffer }
  4959. var   bBlank        : Bool              { Returned : is field blank }
  4960.    ): DBIResult stdcall;
  4961.  
  4962. function DbiPutField (                  { Put a value in the record buffer }
  4963.       hCursor       : hDBICur;          { Cursor }
  4964.       iField        : Word;             { Field # (1..n) }
  4965.       pRecBuff      : Pointer;          { Record buffer }
  4966.       pSrc          : Pointer           { Source field buffer }
  4967.    ): DBIResult stdcall;
  4968.  
  4969. function DbiVerifyField (               { Verifies the field value }
  4970.       hCursor       : hDBICur;          { Cursor }
  4971.       iField        : Word;             { Field # (1..n) }
  4972.       pSrc          : Pointer;          { Field Value }
  4973. var   bBlank        : Bool              { Field is Blank (Returned) }
  4974.    ): DBIResult stdcall;
  4975.  
  4976. function DbiOpenBlob (                  { Open a blob for access }
  4977.       hCursor       : hDBICur;          { Cursor handle }
  4978.       pRecBuf       : Pointer;          { Record Buffer }
  4979.       iField        : Word;             { Field number (1..n) }
  4980.       eOpenMode     : DBIOpenMode       { Open for Read or RW }
  4981.    ): DBIResult stdcall;
  4982.  
  4983. function DbiGetBlobSize (               { Gets the size of a blob }
  4984.       hCursor       : hDBICur;          { Cursor handle }
  4985.       pRecBuf       : Pointer;          { Record Buffer }
  4986.       iField        : Word;             { Field number of blob (1..n) }
  4987. var   iSize         : Longint           { Blob size in bytes }
  4988.    ): DBIResult stdcall;
  4989.  
  4990. function DbiGetBlob (                   { Read bytes from blob }
  4991.       hCursor       : hDBICur;          { Cursor handle }
  4992.       pRecBuf       : Pointer;          { Record Buffer }
  4993.       iField        : Word;             { Field number of blob (1..n) }
  4994.       iOffSet       : Longint;          { Starting position }
  4995.       iLen          : Longint;          { No of bytes to be read }
  4996.       pDest         : Pointer;          { Destination }
  4997. var   iRead         : Longint           { Actual no of bytes read }
  4998.    ): DBIResult stdcall;
  4999.  
  5000. function DbiPutBlob (                   { Write bytes to blob }
  5001.       hCursor       : hDBICur;          { Cursor handle }
  5002.       pRecBuf       : Pointer;          { Record Buffer }
  5003.       iField        : Word;             { Field number of blob (1..n) }
  5004.       iOffSet       : Longint;          { Starting position }
  5005.       iLen          : Longint;          { No of bytes to put }
  5006.       pSrc          : Pointer           { pntr to Source }
  5007.    ): DBIResult stdcall;
  5008.  
  5009. function DbiTruncateBlob (              { Reduces the blob size }
  5010.       hCursor       : hDBICur;          { Cursor handle }
  5011.       pRecBuf       : Pointer;          { Record Buffer }
  5012.       iField        : Word;             { Field number of blob (1..n) }
  5013.       iLen          : Longint           { New blob length }
  5014.    ): DBIResult stdcall;
  5015.  
  5016. function DbiFreeBlob (                  { Closes the blob }
  5017.       hCursor       : hDBICur;          { Cursor handle }
  5018.       pRecBuf       : Pointer;          { Record Buffer }
  5019.       iField        : Word              { Field number of blob (0..n) }
  5020.    ): DBIResult stdcall;
  5021.  
  5022. function DbiGetBlobHeading (            { Get Blob Heading }
  5023.       hCursor       : hDBICur;          { Cursor handle }
  5024.       iField        : Word;             { Field number of blob (1..n) }
  5025.       pRecBuf       : Pointer;          { Record buffer of owner record }
  5026.       pDest         : Pointer           { Destination buffer }
  5027.    ): DBIResult stdcall;
  5028.  
  5029. function DbiSetFieldMap (               { Set a fieldmap }
  5030.       hCur          : hDBICur;          { Cursor handle }
  5031.       iFields       : Word;             { Number of fields }
  5032.       pFldDesc      : pFLDDesc          { Array of field descriptions }
  5033.    ): DBIResult stdcall;
  5034.  
  5035.  
  5036. {=============================================================================}
  5037. {                                TRANSACTIONS                                 }
  5038. {=============================================================================}
  5039.  
  5040. function DbiBeginTran (                 { Begin a transaction }
  5041.       hDb           : hDBIDb;           { Database handle }
  5042.       eXIL          : eXILType;         { Transaction isolation level }
  5043. var   hXact         : hDBIXact          { Returned Xact handle }
  5044.    ): DBIResult stdcall;
  5045.  
  5046. function DbiEndTran (                   { End a transaction }
  5047.       hDb           : hDBIDb;           { Database handle }
  5048.       hXact         : hDBIXact;         { Xact handle }
  5049.       eEnd          : eXEnd             { Xact end type }
  5050.    ): DBIResult stdcall;
  5051.  
  5052. function DbiGetTranInfo (               { Get transaction info }
  5053.       hDb           : hDBIDb;           { Database handle }
  5054.       hXact         : hDBIXact;         { Xact handle }
  5055.       pxInfo        : pXInfo            { Xact info }
  5056.    ): DBIResult stdcall;
  5057.  
  5058. {=============================================================================}
  5059. {                                  LOCKING                                    }
  5060. {=============================================================================}
  5061.  
  5062. function DbiAcqTableLock (              { Lock a table }
  5063.       hCursor       : hDBICur;          { Cursor handle }
  5064.       eLockType     : DBILockType       { Lock type }
  5065.    ): DBIResult stdcall;
  5066.  
  5067. function DbiAcqPersistTableLock (       { Get a persistent lock }
  5068.       hDb           : hDBIDb;           { Database handle }
  5069.       pszTableName  : PChar;            { Table name }
  5070.       pszDriverType : PChar             { Driver type / NULL }
  5071.    ): DBIResult stdcall;
  5072.  
  5073. function DbiRelPersistTableLock (       { Releases a persistent lock }
  5074.       hDb           : hDBIDb;           { Database handle }
  5075.       pszTableName  : PChar;            { Table name }
  5076.       pszDriverType : PChar             { Driver type / NULL }
  5077.    ): DBIResult stdcall;
  5078.  
  5079. function DbiRelTableLock (              { Unlocks Table level locks }
  5080.       hCursor       : hDBICur;          { Cursor handle }
  5081.       bAll          : Bool;             { True for all table level locks }
  5082.       eLockType     : DBILockType       { Specific lock type }
  5083.    ): DBIResult stdcall;
  5084.  
  5085. function DbiRelRecordLock (             { Releases record level locks }
  5086.       hCursor       : hDBICur;          { Cursor handle }
  5087.       bAll          : Bool              { True for all. Default Current. }
  5088.    ): DBIResult stdcall;
  5089.  
  5090. function DbiIsRecordLocked (            { Check if current record is locked }
  5091.       hCursor       : hDBICur;          { Cursor handle }
  5092. var   bLocked       : Bool              { Rec lock status }
  5093.    ): DBIResult stdcall;
  5094.  
  5095. function DbiIsTableLocked (             { Verify if Table is locked }
  5096.       hCursor       : hDBICur;          { Cursor handle }
  5097.       epdxLock      : DBILockType;      { Lock type to verify }
  5098. var   iLocks        : Word              { Nbr of locks of the given type }
  5099.    ): DBIResult stdcall;
  5100.  
  5101. function DbiIsTableShared (             { Verify if this is a shared table }
  5102.       hCursor       : hDBICur;          { Cursor handle }
  5103. var   bShared       : Bool              { Shared status }
  5104.    ): DBIResult stdcall;
  5105.  
  5106. function DbiOpenLockList (              { Get a list of locks }
  5107.       hCursor       : hDBICur;          { Cursor handle }
  5108.       bAllUsers     : Bool;             { True, for all Users locks }
  5109.       bAllLockTypes : Bool;             { True, for all lock types }
  5110. var   hLocks        : hDBICur           { Returned cursor on Lock list }
  5111.    ): DBIResult stdcall;
  5112.  
  5113. function DbiOpenUserList (              { Get a list of users loggedin }
  5114. var   hUsers        : hDBICur           { Returned cursor on user list }
  5115.    ): DBIResult stdcall;
  5116.  
  5117. function DbiSetLockRetry (              { Set Lock wait time }
  5118.       iWait         : SmallInt          { Time in seconds }
  5119.    ): DBIResult stdcall;
  5120.  
  5121. {============================================================================}
  5122. {                              Batch Operations                              }
  5123. {============================================================================}
  5124.  
  5125.  
  5126. function DbiBatchMove (                 { Copy records to destination table }
  5127.       pSrcTblDesc   : pBATTblDesc;      { Source table identification, }
  5128.       hSrcCur       : hDBICur;          {  OR source cursor  ( one must be NULL ) }
  5129.       pDstTblDesc   : pBATTblDesc;      { Destination table identification, }
  5130.       hDstCur       : hDBICur;          {  OR destination cursor ( one must be NULL ) }
  5131.       ebatMode      : eBATMode;         { Batch mode }
  5132.       iFldCount     : Word;             { Size of field maps }
  5133.       pSrcFldMap    : PWord;            { Array of source field numbers }
  5134.       pszIndexName  : PChar;            { If update mode, used to match records }
  5135.       pszIndexTagName : PChar;          { Index tag name }
  5136.       iIndexId      : Word;             { Index  id }
  5137.       pszKeyviolName : PChar;           { Keyviol table name  (optional) }
  5138.       pszProblemsName : PChar;          { Problems table name (optional) }
  5139.       pszChangedName : PChar;           { Changed table name (optional) }
  5140.       lProbRecs     : PLongint;         { Number records written to problem table }
  5141.       lKeyvRecs     : PLongint;         { Number records written to keyv table }
  5142.       lChangedRecs  : PLongint;         { Number records written to changed table }
  5143.       bAbortOnFirstProb : Bool;         { If TRUE, abort on first problem rec }
  5144.       bAbortOnFirstKeyviol : Bool;      { If TRUE, abort on first keyviol rec }
  5145. var   lRecsToMove   : Longint;          { Number of records to read from source }
  5146.       bTransliterate : Bool             { If TRUE, transliterate character data }
  5147.    ): DBIResult stdcall;
  5148.  
  5149. function DbiCopyTable (                 { Copy one table to another }
  5150.       hDb           : hDBIDb;           { Database handle }
  5151.       bOverWrite    : Bool;             { True, to overwrite existing file }
  5152.       pszSrcTableName : PChar;          { Source table name }
  5153.       pszSrcDriverType : PChar;         { Source driver type }
  5154.       pszDestTableName : PChar          { Destination table name }
  5155.    ): DBIResult stdcall;
  5156.  
  5157. function DbiEmptyTable (                { Deletes all records }
  5158.       hDb           : hDBIDb;           { Database handle }
  5159.       hCursor       : hDBICur;          { Cursor (OR) }
  5160.       pszTableName  : PChar;            { Table name }
  5161.       pszDriverType : PChar             { Driver type /NULL }
  5162.    ): DBIResult stdcall;
  5163.  
  5164. function DbiPackTable (                 { Pack a table }
  5165.       hDb           : hDBIDb;           { Database handle }
  5166.       hCursor       : hDBICur;          { Cursor (OR) }
  5167.       pszTableName  : PChar;            { Table name }
  5168.       pszDriverType : PChar;            { Driver type /NULL }
  5169.       bRegenIdxs    : Bool              { Regenerate indexes }
  5170.    ): DBIResult stdcall;
  5171.  
  5172. function DbiRegenIndex (                { Regenerate an index }
  5173.       hDb           : hDBIDb;           { Database handle }
  5174.       hCursor       : hDBICur;          { Cursor (OR) }
  5175.       pszTableName  : PChar;            { Table name }
  5176.       pszDriverType : PChar;            { Driver type /NULL }
  5177.       pszIndexName  : PChar;            { Index name }
  5178.       pszIndexTagName : PChar;          { Index tagname (xbase MDX) }
  5179.       iIndexId      : Word              { Index number }
  5180.    ): DBIResult stdcall;
  5181.  
  5182. function DbiRegenIndexes (              { Regenerate all indexes }
  5183.       hCursor       : hDBICur           { Cursor }
  5184.    ): DBIResult stdcall;
  5185.  
  5186. function DbiSortTable (                 { Sort table }
  5187.       hDb           : hDBIDb;           { Database handle }
  5188.       pszTableName  : PChar;            { Table name of source }
  5189.       pszDriverType : PChar;            { Driver type /NULL }
  5190.       hSrcCur       : hDBICur;          { OR cursor of table to sort }
  5191.       pszSortedName : PChar;            { Destination table (NULL if sort to self) }
  5192.       phSortedCur   : phDBICur;         { If non-null, return cursor on destination }
  5193.       hDstCur       : hDBICur;          { OR cursor of destination }
  5194.       iSortFields   : Word;             { Number of sort fields }
  5195.       piFieldNum    : PWord;            { Array of field numbers }
  5196.       pbCaseInsensitive : PBool;        { Which fields should sort c-i (Opt) }
  5197.       pSortOrder    : pSORTOrder;       { Array of Sort orders (Opt) }
  5198.       ppfSortFn     : ppfSORTCompFn;    { Array of compare fn pntrs (Opt) }
  5199.       bRemoveDups   : Bool;             { TRUE : Remove duplicates }
  5200.       hDuplicatesCur : hDBICur;         { Cursor to duplicates table (Opt) }
  5201. var   lRecsSort     : Longint           { In/out param. - sort this number }
  5202.    ): DBIResult stdcall;
  5203.  
  5204.  
  5205. {============================================================================}
  5206. {                           Create & Restructure                             }
  5207. {============================================================================}
  5208.  
  5209. function DbiCreateTable (               { Create a new table }
  5210.       hDb           : hDBIDb;           { Database handle }
  5211.       bOverWrite    : Bool;             { True, to overwrite existing file. }
  5212. var   crTblDsc      : CRTblDesc         { Table description }
  5213.    ): DBIResult stdcall;
  5214.  
  5215. function DbiCreateInMemTable (          { Create a temporary table (Logical) }
  5216.       hDb           : hDBIDb;           { Database handle }
  5217.       pszName       : PChar;            { Logical Name }
  5218.       iFields       : Word;             { No of fields }
  5219.       pfldDesc      : pFLDDesc;         { Array of field descriptors }
  5220. var   hCursor       : hDBICur           { Returned cursor handle }
  5221.    ): DBIResult stdcall;
  5222.  
  5223. function DbiCreateTempTable (           { Create temporary table (Physical) }
  5224.       hDb           : hDBIDb;           { Database handle }
  5225. var   crTblDsc      : CRTblDesc;        { Table description }
  5226. var   hCursor       : hDBICur           { Returned cursor on table }
  5227.    ): DBIResult stdcall;
  5228.  
  5229. function DbiDoRestructure (             { Restructure a table }
  5230.       hDb           : hDBIDb;           { Database handle }
  5231.       iTblDescCount : Word;             { Number of table descriptors (1) }
  5232.       pTblDesc      : pCRTblDesc;       { Array of table descs }
  5233.       pszSaveAs     : PChar;            { Restructure to this table }
  5234.       pszKeyviolName : PChar;           { Keyviol table name  (optional) }
  5235.       pszProblemsName : PChar;          { Problems table name (optional) }
  5236.       bAnalyzeOnly  : Bool              { Analyze restructure }
  5237.    ): DBIResult stdcall;
  5238.  
  5239. function DbiRenameTable (               { Rename table & family }
  5240.       hDb           : hDBIDb;           { Database handle }
  5241.       pszOldName    : PChar;            { Old name }
  5242.       pszDriverType : PChar;            { Driver type /NULL }
  5243.       pszNewName    : PChar             { New name }
  5244.    ): DBIResult stdcall;
  5245.  
  5246. function DbiDeleteTable (               { Delete a table }
  5247.       hDb           : hDBIDb;           { Database handle }
  5248.       pszTableName  : PChar;            { Name including any path }
  5249.       pszDriverType : PChar             { Driver type /NULL }
  5250.    ): DBIResult stdcall;
  5251.  
  5252. function DbiAddIndex (                  { Add a new index }
  5253.       hDb           : hDBIDb;           { Database handle }
  5254.       hCursor       : hDBICur;          { Cursor (OR) }
  5255.       pszTableName  : PChar;            { Table name including any path }
  5256.       pszDriverType : PChar;            { Driver type /NULL }
  5257. var   IdxDesc       : IDXDesc;          { Description of the index }
  5258.       pszKeyviolName : PChar            { Keyviol table name (optional) }
  5259.    ): DBIResult stdcall;
  5260.  
  5261. function DbiDeleteIndex (               { Delete index }
  5262.       hDb           : hDBIDb;           { Database handle }
  5263.       hCursor       : hDBICur;          { Cursor (OR) }
  5264.       pszTableName  : PChar;            { Table name }
  5265.       pszDriverType : PChar;            { Driver type /NULL }
  5266.       pszIndexName  : PChar;            { Index name }
  5267.       pszIndexTagName : PChar;          { Index tagname (xbase MDX) }
  5268.       iIndexId      : Word              { Index number }
  5269.    ): DBIResult stdcall;
  5270.  
  5271. {===========================================================================}
  5272. {                            Error Info                                     }
  5273. {===========================================================================}
  5274.  
  5275. function DbiGetErrorEntry (             { Get error entry }
  5276.       uEntry        : Word;             { Error stack entry }
  5277. var   ulNativeError : Longint;          { Returned. Native error code, if any }
  5278.       pszError      : PChar             { Returned. Error string, if any }
  5279.    ): DBIResult stdcall;
  5280.  
  5281. function DbiGetErrorInfo (              { Return info on last error }
  5282.       bFull         : Bool;             { If Full details }
  5283. var   ErrInfo       : DBIErrInfo        { Error Info }
  5284.    ): DBIResult stdcall;
  5285.  
  5286. function DbiGetErrorString (            { Get message for error code }
  5287.       rslt          : DBIResult;        { Engine error code }
  5288.       pszError      : PChar             { Error string for the error }
  5289.    ): DBIResult stdcall;
  5290.  
  5291. function DbiGetErrorContext (           { Get specific Context if available }
  5292.       eContext      : SmallInt;         { Context type }
  5293.       pszContext    : PChar             { Context string (MAXMSGLEN +1) }
  5294.    ): DBIResult stdcall;
  5295.  
  5296. {============================================================================}
  5297. {                              Dbi Services                                  }
  5298. {============================================================================}
  5299.  
  5300. function DbiDateEncode (                { Encode Date components into Date }
  5301.       iMon          : Word;             { Month    (1..12) }
  5302.       iDay          : Word;             { Day      (1..31) }
  5303.       iYear         : SmallInt;         { Year     (0..2**16-1) }
  5304. var   dateD         : DBIDATE           { Encoded date }
  5305.    ): DBIResult stdcall;
  5306.  
  5307. function DbiDateDecode (                { Decode Date into components }
  5308.       dateD         : DBIDATE;          { Encoded Date }
  5309. var   iMon          : Word;             { Month }
  5310. var   iDay          : Word;             { Day }
  5311. var   iYear         : SmallInt          { Year }
  5312.    ): DBIResult stdcall;
  5313.  
  5314. function DbiTimeEncode (                { Encode Time components into TIME }
  5315.       iHour         : Word;             { Hours (0..23) }
  5316.       iMin          : Word;             { Minutes (0..59) }
  5317.       iMilSec       : Word;             { Milli Seconds (0..59999) }
  5318. var   timeT         : Time              { Encoded Time }
  5319.    ): DBIResult stdcall;
  5320.  
  5321. function DbiTimeDecode (                { Decode TIME into components }
  5322.       timeT         : Time;             { Encoded Time }
  5323. var   iHour         : Word;             { Hours (0..23) }
  5324. var   iMin          : Word;             { Minutes (0..59) }
  5325. var   iMilSec       : Word              { Milli Seconds (0..59999) }
  5326.    ): DBIResult stdcall;
  5327.  
  5328. function DbiTimeStampEncode (           { Encode Date & TIme into Date+Time }
  5329.       dateD         : DBIDATE;          { Encoded Date }
  5330.       timeT         : Time;             { Encoded Time }
  5331. var   tsTS          : TimeStamp         { Encoded Date+Time }
  5332.    ): DBIResult stdcall;
  5333.  
  5334. function DbiTimeStampDecode (           { Decode Date & Time from Date+Time }
  5335.       tsTS          : TIMESTAMP;        { Encoded Date+Time }
  5336. var   dateD         : DBIDATE;          { Encoded Date }
  5337. var   timeT         : Time              { Encoded Time }
  5338.    ): DBIResult stdcall;
  5339.  
  5340.  
  5341. function DbiBcdFromFloat (              { Converts FLOAT number into FMTBcd format }
  5342. var   iVal          : Double;           { Float to convert }
  5343.       iPrecision    : Word;             { Precision of BCD }
  5344.       iPlaces       : Word;             { Number of decimals }
  5345. var   Bcd           : FMTBcd            { returns Bcd number (length = iPrecision +2) }
  5346.    ): DBIResult stdcall;
  5347.  
  5348. function DbiBcdToFloat (                { Converts FMTBcd number to FLOAT }
  5349. var   Bcd           : FMTBcd;           { Bcd number to convert }
  5350. var   iVal          : Double            { Returns converted float }
  5351.    ): DBIResult stdcall;
  5352.  
  5353. {===========================================================================}
  5354. {                           CallBacks                                       }
  5355. {===========================================================================}
  5356.  
  5357. function DbiRegisterCallBack (          { Register a call back fn }
  5358.       hCursor       : hDBICur;          { Cursor (Optional) }
  5359.       ecbType       : CBType;           { Type of call back }
  5360.       iClientData   : Longint;          { Pass-thru client data }
  5361.       iCbBufLen     : Word;             { Callback buffer len }
  5362.       CbBuf         : Pointer;          { Pointer to callback buffer }
  5363.       pfCb          : pfDBICallBack     { Call back fn being registered }
  5364.    ): DBIResult stdcall;
  5365.  
  5366. function DbiGetCallBack (               { Register a call back fn }
  5367.       hCursor       : hDBICur;          { Cursor (Optional) }
  5368.       ecbType       : CBType;           { Type of call back }
  5369.       piClientData  : PLongint;         { Pass-thru client data }
  5370.       piCbBufLen    : PWord;            { Callback buffer len }
  5371.       ppCbBuf       : Pointer;          { Pointer to callback buffer }
  5372. var   pfCb          : pfDBICallBack     { Call back fn being registered }
  5373.    ): DBIResult stdcall;
  5374.  
  5375. {============================================================================}
  5376. {                          Date, time formats                                }
  5377. {============================================================================}
  5378.  
  5379.  
  5380. function DbiGetDateFormat (             { Get current date format }
  5381. var   fmtDate       : FMTDate
  5382.    ): DBIResult stdcall;
  5383.  
  5384. function DbiSetDateFormat (             { Set current date format }
  5385. var   fmtDate       : FMTDate
  5386.    ): DBIResult stdcall;
  5387.  
  5388. function DbiGetTimeFormat (             { Get current time format }
  5389. var   fmtTime       : FMTTime
  5390.    ): DBIResult stdcall;
  5391.  
  5392. function DbiSetTimeFormat (             { Set current time format }
  5393. var   fmtTime       : FMTTime
  5394.    ): DBIResult stdcall;
  5395.  
  5396. function DbiGetNumberFormat (           { Get current number format }
  5397. var   fmtNumber     : FMTNumber
  5398.    ): DBIResult stdcall;
  5399.  
  5400. function DbiSetNumberFormat (           { Set current number format }
  5401. var   fmtNumber     : FMTNumber
  5402.    ): DBIResult stdcall;
  5403.  
  5404. {============================================================================}
  5405. {                      Conversions                                           }
  5406. {============================================================================}
  5407.  
  5408. function DbiNativeToAnsi (              { Convert from native to Ansi }
  5409.       LdObj         : Pointer;          { Language driver }
  5410.       pAnsiStr      : PChar;            { Destination buffer (opt) }
  5411.       pNativeStr    : PChar;            { Source buffer }
  5412.       iLen          : Longint;          { Length of buffer (opt) }
  5413. var   bDataLoss     : Bool              { Returns TRUE if conversion will loose data (opt) }
  5414.    ): DBIResult stdcall;
  5415.  
  5416. function DbiAnsiToNative (              { Convert from Ansi to native }
  5417.       LdObj         : Pointer;          { Language driver }
  5418.       pNativeStr    : PChar;            { Destination buffer (opt) }
  5419.       pAnsiStr      : PChar;            { Source buffer }
  5420.       iLen          : Longint;          { Length of buffer (opt) }
  5421. var   bDataLoss     : Bool              { Returns TRUE if conversion will loose data (opt) }
  5422.    ): DBIResult stdcall;
  5423.  
  5424. {============================================================================}
  5425. {                            Filters                                         }
  5426. {============================================================================}
  5427.  
  5428. function DbiAddFilter (                 { Add a filter to the cursor }
  5429.       hCursor       : hDBICur;          { Cursor handle }
  5430.       iClientData   : Longint;          { Client supplied data      (opt) }
  5431.       iPriority     : Word;             { 1..N with 1 being highest (opt) }
  5432.       bCanAbort     : Bool;             { TRUE if pfFiltercan return ABORT (opt) }
  5433.       pcanExpr      : pCANExpr;         { Expression tree        (opt) }
  5434.       pfFilter      : pfGENFilter;      { ptr to filter function (opt) }
  5435. var   hFilter       : hDBIFilter        { Returns filter handle }
  5436.    ): DBIResult stdcall;
  5437.  
  5438. function DbiDropFilter (                { Drop a filter }
  5439.       hCursor       : hDBICur;          { Cursor handle }
  5440.       hFilter       : hDBIFilter        { Filter handle }
  5441.    ): DBIResult stdcall;
  5442.  
  5443. function DbiActivateFilter (            { Activate a Filter }
  5444.       hCursor       : hDBICur;          { Cursor handle }
  5445.       hFilter       : hDBIFilter        { Filter handle }
  5446.    ): DBIResult stdcall;
  5447.  
  5448. function DbiDeactivateFilter (          { Deactivate Filter }
  5449.       hCursor       : hDBICur;          { Cursor handle }
  5450.       hFilter       : hDBIFilter        { Filter handle }
  5451.    ): DBIResult stdcall;
  5452.  
  5453. function DbiGetFilterInfo (             { Get filter information }
  5454.       hCur          : hDBICur;          { Cursor handle }
  5455.       hFilter       : hDBIFilter;       { Filter handle          /NULL }
  5456.       iFilterId     : Word;             { Filter id              /0 }
  5457.       iFilterSeqNo  : Word;             { Filter sequence number /0 }
  5458. var   Filterinfo    : FilterInfo        { Returns filter info }
  5459.    ): DBIResult stdcall;
  5460.  
  5461. {============================================================================}
  5462. {                            Linked Cursors                                  }
  5463. {============================================================================}
  5464.  
  5465. function DbiBeginLinkMode (             { Convert cursor to a link cursor }
  5466. var   hCursor       : hDBICur           { In/Out : returns new cursor }
  5467.    ): DBIResult stdcall;
  5468.  
  5469. function DbiEndLinkMode (               { Convert cursor back to normal cursor }
  5470. var   hCursor       : hDBICur           { In/Out : returns original cursor }
  5471.    ): DBIResult stdcall;
  5472.  
  5473. function DbiLinkDetail (                { Link detail to master }
  5474.       hMstrCursor   : hDBICur;          { Master cursor }
  5475.       hDetlCursor   : hDBICur;          { Detail cursor }
  5476.       iLnkFields    : Word;             { Number of link fields }
  5477.       piMstrFields  : PWord;            { Array of fields in master }
  5478.       piDetlFields  : PWord             { Array of fields in detail }
  5479.    ): DBIResult stdcall;
  5480.  
  5481. function DbiLinkDetailToExp (           { Link detail to a master using exp }
  5482.       hCursorMstr   : hDBICur;          { Master cursor }
  5483.       hCursorDetl   : hDBICur;          { Detail cursor }
  5484.       iKeyLen       : Word;             { Key length to match }
  5485.       pszMstrExp    : PChar             { Expression string }
  5486.    ): DBIResult stdcall;
  5487.  
  5488. function DbiUnlinkDetail (              { Unlink detail from master }
  5489.       hDetlCursor   : hDBICur           { Detail cursor to unlink }
  5490.    ): DBIResult stdcall;
  5491.  
  5492. function DbiGetLinkStatus (             { Query linkage info for table }
  5493.       hCursor       : hDBICur;          { Cursor handle }
  5494. var   hCursorMstr   : hDBICur;          { Returns master cursor, if any   (opt) }
  5495. var   hCursorDet    : hDBICur;          { Returns first detail cursor, if any (opt) }
  5496. var   hCursorSib    : hDBICur           { Returns next sibling detail cursor, if any (opt) }
  5497.    ): DBIResult stdcall;
  5498.  
  5499.  
  5500. {===========================================================================}
  5501. {                            Translation                                    }
  5502. {===========================================================================}
  5503.  
  5504.  
  5505. function DbiTranslateRecordStructure (  { Translate a record }
  5506.       pszSrcDriverType : PChar;         { Source driver type }
  5507.       iFlds         : Word;             { Number of fields }
  5508.       pfldsSrc      : pFLDDesc;         { Array of source fields: logical or physical types }
  5509.       pszDstDriverType : PChar;         { Destination driver type }
  5510.       pszLangDriver : PChar;            { Language driver for destination }
  5511.       pfldsDst      : pFLDDesc;         { Array of dest. fields returned }
  5512.       bCreatable    : Bool              { TRUE -> map to creatable fields only. }
  5513.    ): DBIResult stdcall;
  5514.  
  5515. function DbiOpenFieldXlt (              { Open translation object }
  5516.       pszSrcTblType : PChar;            { NULL for Logical }
  5517.       pszSrcLangDrv : PChar;            { NULL if no tranliteration }
  5518.       pfldSrc       : pFLDDesc;         { source field descriptor }
  5519.       pszDestTblType : PChar;           { NULL for Logical }
  5520.       pszDstLangDrv : PChar;            { NULL if no tranliteration }
  5521.       pfldDest      : pFLDDesc;         { Source field descriptor }
  5522. var   bDataLoss     : Bool;             { Set to TRUE, for data loss }
  5523. var   hXlt          : hDBIXlt           { Returned translate handle }
  5524.    ): DBIResult stdcall;
  5525.  
  5526. function DbiTranslateField (            { Translate a field }
  5527.       hXlt          : hDBIXlt;          { Translation handle }
  5528.       pSrc          : Pointer;          { Source field }
  5529.       pDest         : Pointer           { Destination field }
  5530.    ): DBIResult stdcall;
  5531.  
  5532. function DbiCloseFieldXlt (             { Close translation object }
  5533.       hXlt          : hDBIXlt           { Translation handle }
  5534.    ): DBIResult stdcall;
  5535.  
  5536. {=========================================================================}
  5537. {    Delayed Updates                                                      }
  5538. {=========================================================================}
  5539.  
  5540. function DbiBeginDelayedUpdates (       { put cursor in delayed update mode }
  5541. var   hCursor       : hDBICur           { In/Out : returns new Cursor }
  5542.    ): DBIResult stdcall;
  5543.  
  5544. function DbiEndDelayedUpdates (         { Convert cursor back to normal cursor }
  5545. var   hCursor       : hDBICur           { In/Out : returns original Cursor }
  5546.    ): DBIResult stdcall;
  5547.  
  5548. function DbiApplyDelayedUpdates (       { Perform the specified operation. }
  5549.       hCursor       : hDBICur;          { Delayed update cursor handle }
  5550.       eUpdCmd       : DBIDelayedUpdCmd  { Op Type: Commit or Rollback. }
  5551.    ): DBIResult stdcall;
  5552.  
  5553. {===========================================================================}
  5554. {                                 MISC.                                     }
  5555. {===========================================================================}
  5556.  
  5557.  
  5558. function DbiGetTableOpenCount (         {  Get local cursor count }
  5559.       hDb           : hDBIDb;           { Database }
  5560.       pszTableName  : PChar;            { Table name }
  5561.       pszDriverType : PChar;            { Driver type /NULL }
  5562. var   iOpenCount    : Word              { returned number of cursors }
  5563.    ): DBIResult stdcall;
  5564.  
  5565. function DbiUseIdleTime: DBIResult stdcall;     { Use Idle time }
  5566.  
  5567. function DbiGetLdObj (                  { Get language driver }
  5568.       hCursor       : hDBICur;          { Cursor handle }
  5569. var   pLdObj        : Pointer           { Returned language driver object }
  5570.    ): DBIResult stdcall;
  5571.  
  5572. function DbiGetLdName (                 { Get language driver name from table }
  5573.       pszDriver     : PChar;            { Driver name }
  5574.       pObjName      : PChar;            { Name of object, i.e. table name }
  5575.       pLdName       : PChar             { Returned language driver name }
  5576.    ): DBIResult stdcall;
  5577.  
  5578. function DbiFormFullName (              { Form Full Name }
  5579.       hDb           : hDBIDb;           { Database handle }
  5580.       pszTableName  : PChar;            { Table name }
  5581.       pszDriverType : PChar;            { Driver type /NULL }
  5582.       pszFullName   : PChar             { Returns full name }
  5583.    ): DBIResult stdcall;
  5584.  
  5585. function DbiAddPassword (               { Add a password to current session }
  5586.       pszPassword   : PChar             { Password }
  5587.    ): DBIResult stdcall;
  5588.  
  5589. function DbiDropPassword (              { Drop a password from current session }
  5590.       pszPassword   : PChar             { password/NULL }
  5591.    ): DBIResult stdcall;
  5592.  
  5593. function DbiGetNetUserName (            { Get network username }
  5594.       pszNetUserName : PChar            { Returns username }
  5595.    ): DBIResult stdcall;
  5596.  
  5597.  
  5598. function DbiDebugLayerOptions (         { Get SDK debug layer options }
  5599.       iOption       : Word;             { Option }
  5600.       pDebugFile    : PChar
  5601.    ): DBIResult stdcall;
  5602.  
  5603. function DbiOpenCfgInfoList (           { Open a cursor on "Config" }
  5604.       hCfg          : hDBICfg;          { NULL }
  5605.       eOpenMode     : DBIOpenMode;      { ReadWrite or readonly }
  5606.       eConfigMode   : CFGMode;          { Config mode }
  5607.       pszCfgPath    : PChar;            { Path }
  5608. var   hCur          : hDBICur           { Returned cursor }
  5609.    ): DBIResult stdcall;
  5610.  
  5611. function DbiImportODBC(                 { Import current ODBC drivers and data sources }
  5612.       hCfg          : hDBICfg;          { NULL }
  5613.       bPersist      : Bool              { Persistent or session relative }
  5614.    ): DBIResult stdcall;
  5615.  
  5616. function DbiAddAlias (                  { Add a new alias }
  5617.       hCfg          : hDBICfg;          { NULL }
  5618.       pszAliasName  : PChar;            { Alias name }
  5619.       pszDriverType : PChar;            { Driver type for alias }
  5620.       pszParams     : PChar;            { Optional parameters }
  5621.       bPersist      : Bool              { Persistent or session relative }
  5622.    ): DBIResult stdcall;
  5623.  
  5624. function DbiDeleteAlias (               { Delete an alias }
  5625.       hCfg          : hDBICfg;          { NULL }
  5626.       pszAliasName  : PChar             { Alias name }
  5627.    ): DBIResult stdcall;
  5628.  
  5629. function DbiAddDriver(                  { Add a new driver }
  5630.       hCfg          : hDBICfg;          { NULL }
  5631.       pszDriverName : PChar;            { Driver name }
  5632.       pszParams     : PChar;            { Optional parameters }
  5633.       bPersist      : Bool              { Persistent or session relative }
  5634.    ): DBIResult stdcall;
  5635.  
  5636. function DbiDeleteDriver(               { Delete a driver }
  5637.       hCfg          : hDBICfg;          { NULL }
  5638.       pszDriverName : PChar;            { Driver name }
  5639.       bSave         : Bool              { Save config file }
  5640.    ): DBIResult stdcall;
  5641.  
  5642. function DbiGetSQLRequest(
  5643.       hDb           : hDBIDb;           { Database handle }
  5644.       pszSQLStmt    : pByte;            { SQL statement }
  5645.       var bIsDDL    : Boolean;          { Returned TRUE if statement is DDL. }
  5646.       var pReq      : PSQLRequest       { Returned Handle to SQLRequest. }
  5647.    ): DBIResult stdcall;
  5648.  
  5649. function DbiFreeSQLRequest(
  5650.       pReq          : PSQLRequest
  5651.    ): DBIResult stdcall;
  5652.  
  5653.  
  5654.  
  5655.  
  5656.  
  5657.  
  5658.  
  5659.  
  5660.  
  5661.  
  5662.  
  5663.  
  5664.  
  5665.  
  5666.  
  5667.  
  5668.  
  5669.  
  5670.  
  5671.  
  5672.  
  5673.  
  5674.  
  5675.  
  5676.  
  5677.  
  5678.  
  5679.  
  5680.  
  5681.  
  5682.  
  5683.  
  5684.  
  5685.  
  5686.  
  5687.  
  5688.  
  5689.  
  5690.  
  5691.  
  5692.  
  5693.  
  5694.  
  5695.  
  5696.  
  5697.  
  5698.  
  5699.  
  5700.  
  5701.  
  5702.  
  5703.  
  5704.  
  5705.  
  5706.  
  5707.  
  5708.  
  5709.  
  5710.  
  5711.  
  5712.  
  5713.  
  5714.  
  5715.  
  5716.  
  5717.  
  5718.  
  5719.  
  5720.  
  5721.  
  5722.  
  5723.  
  5724.  
  5725.  
  5726.  
  5727.  
  5728.  
  5729.  
  5730.  
  5731.  
  5732.  
  5733.  
  5734.  
  5735.  
  5736.  
  5737.  
  5738.  
  5739.  
  5740.  
  5741.  
  5742.  
  5743.  
  5744.  
  5745.  
  5746.  
  5747. {===========================================================================}
  5748. {                      Query Management                                     }
  5749. {===========================================================================}
  5750.  
  5751. function DbiQExecDirect (               { Execute query }
  5752.       hDb           : hDBIDb;           { Database handle }
  5753.       eQryLang      : DBIQryLang;       { Query language }
  5754.       pszQuery      : PChar;            { Query }
  5755.       phCur         : phDBICur          { Returned cursor on result set }
  5756.    ): DBIResult stdcall;
  5757.  
  5758. function DbiQAlloc (                    { Allocates a statement handle }
  5759.       hDb           : hDBIDb;           { Database handle }
  5760.       eQryLang      : DBIQryLang;       { Query language }
  5761. var   hStmt         : hDBIStmt          { Returned statment handle }
  5762.    ): DBIResult stdcall;
  5763.  
  5764. function DbiQPrepare (                  { Prepare a query }
  5765.       hStmt         : hDBIStmt;         { Returned statment handle }
  5766.       pszQuery      : PChar             { Query }
  5767.    ): DBIResult stdcall;
  5768.  
  5769. function DbiQPrepareExt (               { Prepare a query }
  5770.       hDb           : hDBIDb;           { Database handle }
  5771.       eQryLang      : DBIQryLang;       { Query language }
  5772.       pszQuery      : PChar;            { Query }
  5773.       propBits      : Word;             { properties for Prepare, e.g. qprepFORUPDATE }
  5774. var   hStmt         : hDBIStmt          { Returned statment handle }
  5775.    ): DBIResult stdcall;
  5776.  
  5777. function DbiQExec (                     { Execute prepared query }
  5778.       hStmt         : hDBIStmt;         { Statement handle }
  5779.       phCur         : phDBICur          { Returned handle on result set }
  5780.    ): DBIResult stdcall;
  5781.  
  5782. function DbiQFree (                     { Free statement handle }
  5783. var   hStmt         : hDBIStmt          { Statement handle }
  5784.    ): DBIResult stdcall;
  5785.  
  5786. function DbiQSetParams (                { Set query options }
  5787.       hStmt         : hDBIStmt;         { Statement handle }
  5788.       uFldDescs     : Word;             { Number of parameter field descriptors }
  5789.       paFldDescs    : pFLDDesc;         { Array of parameter field descriptors }
  5790.       pRecBuff      : Pointer           { Record buffer }
  5791.    ): DBIResult stdcall;
  5792.  
  5793. function DbiQInstantiateAnswer (        { Create answer table }
  5794.       hStmt         : hDBIStmt;         { Statement Handle }
  5795.       hCur          : hDBICur;          { Cursor Handle }
  5796.       pszAnswerName : PChar;            { Answer Table Name/NULL }
  5797.       pszAnswerType : PChar;            { Answer Table Type/NULL }
  5798.       bOverWrite    : Bool;             { Overwrite Flag }
  5799.       phCur         : phDBICur          { cursor to instantiated table (output)(optional) }
  5800.    ): DBIResult stdcall;
  5801.  
  5802. function DbiQExecProcDirect (           { Direct execution of stored procedure }
  5803.       hDb           : hDBIDb;           { Database handle }
  5804.       pszProc       : PChar;            { Stored procedure name }
  5805.       uParamDescs   : Word;             { Number of parameter descriptors }
  5806.       paParamDescs  : pSPParamDesc;     { Array of parameter descriptors }
  5807.       pRecBuff      : Pointer;          { Record buffer }
  5808. var   hCur          : hDBICur           { Returned handle on result set }
  5809.    ): DBIResult stdcall;
  5810.  
  5811. function DbiQPrepareProc (              { Prepare a stored procedure }
  5812.       hDb           : hDBIDb;           { Database handle }
  5813.       pszProc       : PChar;            { Stored procedure name }
  5814.       uParamDescs   : Word;             { Number of parameter descriptors }
  5815.       paParamDescs  : pSPParamDesc;     { Array of parameter descriptors }
  5816.       pRecBuff      : Pointer;          { Record buffer }
  5817. var   hStmt         : hDBIStmt          { Returned statment handle }
  5818.    ): DBIResult stdcall;
  5819.  
  5820. function DbiQSetProcParams (            { Set procedure params }
  5821.       hStmt         : hDBIStmt;         { Statement handle }
  5822.       uParamDescs   : Word;             { Number of parameter descriptors }
  5823.       paParamDescs  : pSPParamDesc;     { Array of parameter descriptors }
  5824.       pRecBuff      : Pointer           { Record buffer }
  5825.    ): DBIResult stdcall;
  5826.  
  5827. type
  5828.   PSTMTBaseDesc = ^STMTBaseDesc;
  5829.   STMTBaseDesc = packed record
  5830.     szDatabase   : DBINAME;
  5831.     szTableName  : DBITBLNAME;
  5832.     szFieldName  : DBINAME;
  5833.     bExpression  : Bool;
  5834.     bAggregate   : Bool;
  5835.     bConstant    : Bool;
  5836.   end;
  5837.  
  5838. function DbiQGetBaseDescs(
  5839.       hStmt         : hDBIStmt;         { Statement Handle }
  5840. var   hCur          : hDBICur           { Cursor of type STMTBaseDesc }
  5841.    ): DBIResult stdcall;
  5842.  
  5843.  
  5844.  
  5845.  
  5846.  
  5847.  
  5848.  
  5849.  
  5850.  
  5851.  
  5852.  
  5853.  
  5854.  
  5855.  
  5856.  
  5857.  
  5858.  
  5859.  
  5860.  
  5861.  
  5862.  
  5863.  
  5864.  
  5865.  
  5866.  
  5867.  
  5868.  
  5869.  
  5870.  
  5871.  
  5872.  
  5873.  
  5874.  
  5875.  
  5876.  
  5877.  
  5878.  
  5879.  
  5880.  
  5881.  
  5882.  
  5883.  
  5884.  
  5885.  
  5886.  
  5887.  
  5888.  
  5889.  
  5890.  
  5891.  
  5892.  
  5893.  
  5894.  
  5895.  
  5896.  
  5897.  
  5898.  
  5899.  
  5900.  
  5901.  
  5902.  
  5903.  
  5904.  
  5905.  
  5906.  
  5907.  
  5908.  
  5909.  
  5910.  
  5911.  
  5912.  
  5913.  
  5914.  
  5915.  
  5916.  
  5917.  
  5918.  
  5919.  
  5920.  
  5921.  
  5922.  
  5923.  
  5924.  
  5925.  
  5926.  
  5927.  
  5928.  
  5929.  
  5930.  
  5931.  
  5932.  
  5933.  
  5934.  
  5935.  
  5936.  
  5937.  
  5938.  
  5939.  
  5940.  
  5941.  
  5942.  
  5943.  
  5944.  
  5945.  
  5946.  
  5947.  
  5948.  
  5949.  
  5950.  
  5951.  
  5952.  
  5953.  
  5954.  
  5955.  
  5956.  
  5957.  
  5958.  
  5959.  
  5960.  
  5961.  
  5962.  
  5963.  
  5964.  
  5965.  
  5966.  
  5967.  
  5968.  
  5969.  
  5970.  
  5971.  
  5972.  
  5973.  
  5974.  
  5975.  
  5976.  
  5977.  
  5978.  
  5979.  
  5980.  
  5981.  
  5982.  
  5983.  
  5984.  
  5985.  
  5986.  
  5987.  
  5988.  
  5989.  
  5990.  
  5991.  
  5992.  
  5993.  
  5994.  
  5995.  
  5996.  
  5997.  
  5998.  
  5999.  
  6000.  
  6001.  
  6002.  
  6003.  
  6004.  
  6005.  
  6006.  
  6007.  
  6008.  
  6009.  
  6010.  
  6011.  
  6012.  
  6013.  
  6014.  
  6015.  
  6016.  
  6017.  
  6018.  
  6019.  
  6020.  
  6021.  
  6022.  
  6023.  
  6024.  
  6025.  
  6026.  
  6027.  
  6028.  
  6029.  
  6030.  
  6031.  
  6032.  
  6033.  
  6034.  
  6035.  
  6036.  
  6037.  
  6038.  
  6039.  
  6040.  
  6041.  
  6042.  
  6043.  
  6044.  
  6045.  
  6046.  
  6047.  
  6048.  
  6049.  
  6050.  
  6051.  
  6052.  
  6053.  
  6054.  
  6055.  
  6056.  
  6057.  
  6058.  
  6059.  
  6060.  
  6061.  
  6062.  
  6063.  
  6064.  
  6065.  
  6066.  
  6067.  
  6068.  
  6069.  
  6070.  
  6071.  
  6072.  
  6073.  
  6074.  
  6075.  
  6076.  
  6077.  
  6078.  
  6079.  
  6080.  
  6081.  
  6082.  
  6083.  
  6084.  
  6085.  
  6086.  
  6087.  
  6088.  
  6089.  
  6090.  
  6091.  
  6092.  
  6093.  
  6094.  
  6095.  
  6096.  
  6097.  
  6098.  
  6099.  
  6100.  
  6101.  
  6102.  
  6103.  
  6104.  
  6105.  
  6106.  
  6107.  
  6108.  
  6109.  
  6110.  
  6111.  
  6112.  
  6113.  
  6114.  
  6115.  
  6116.  
  6117.  
  6118.  
  6119.  
  6120.  
  6121.  
  6122.  
  6123.  
  6124.  
  6125.  
  6126.  
  6127.  
  6128.  
  6129.  
  6130.  
  6131.  
  6132.  
  6133.  
  6134.  
  6135.  
  6136.  
  6137.  
  6138.  
  6139.  
  6140.  
  6141.  
  6142.  
  6143.  
  6144.  
  6145.  
  6146.  
  6147.  
  6148.  
  6149.  
  6150.  
  6151.  
  6152.  
  6153.  
  6154.  
  6155.  
  6156.  
  6157.  
  6158.  
  6159.  
  6160.  
  6161.  
  6162.  
  6163.  
  6164.  
  6165.  
  6166.  
  6167.  
  6168.  
  6169.  
  6170.  
  6171.  
  6172.  
  6173.  
  6174.  
  6175.  
  6176.  
  6177.  
  6178.  
  6179.  
  6180.  
  6181.  
  6182.  
  6183.  
  6184.  
  6185.  
  6186.  
  6187.  
  6188.  
  6189.  
  6190.  
  6191.  
  6192.  
  6193.  
  6194.  
  6195.  
  6196.  
  6197.  
  6198.  
  6199.  
  6200.  
  6201.  
  6202.  
  6203.  
  6204.  
  6205.  
  6206.  
  6207.  
  6208.  
  6209.  
  6210.  
  6211.  
  6212.  
  6213.  
  6214.  
  6215.  
  6216.  
  6217.  
  6218.  
  6219.  
  6220.  
  6221.  
  6222.  
  6223.  
  6224.  
  6225.  
  6226.  
  6227.  
  6228.  
  6229.  
  6230.  
  6231.  
  6232.  
  6233.  
  6234.  
  6235.  
  6236.  
  6237.  
  6238.  
  6239.  
  6240.  
  6241.  
  6242.  
  6243.  
  6244.  
  6245.  
  6246.  
  6247.  
  6248.  
  6249.  
  6250.  
  6251.  
  6252.  
  6253.  
  6254.  
  6255.  
  6256.  
  6257.  
  6258.  
  6259.  
  6260.  
  6261.  
  6262.  
  6263.  
  6264.  
  6265.  
  6266.  
  6267.  
  6268.  
  6269.  
  6270.  
  6271.  
  6272.  
  6273.  
  6274.  
  6275.  
  6276.  
  6277.  
  6278.  
  6279.  
  6280.  
  6281.  
  6282.  
  6283.  
  6284.  
  6285.  
  6286.  
  6287.  
  6288.  
  6289.  
  6290.  
  6291.  
  6292.  
  6293.  
  6294.  
  6295.  
  6296.  
  6297.  
  6298.  
  6299.  
  6300.  
  6301.  
  6302.  
  6303.  
  6304.  
  6305.  
  6306.  
  6307.  
  6308.  
  6309.  
  6310.  
  6311.  
  6312.  
  6313.  
  6314.  
  6315.  
  6316.  
  6317.  
  6318.  
  6319.  
  6320.  
  6321.  
  6322.  
  6323.  
  6324.  
  6325.  
  6326.  
  6327.  
  6328.  
  6329.  
  6330.  
  6331.  
  6332.  
  6333.  
  6334.  
  6335.  
  6336.  
  6337.  
  6338.  
  6339.  
  6340.  
  6341.  
  6342.  
  6343.  
  6344.  
  6345.  
  6346.  
  6347.  
  6348.  
  6349.  
  6350.  
  6351.  
  6352.  
  6353.  
  6354.  
  6355.  
  6356.  
  6357.  
  6358.  
  6359.  
  6360.  
  6361.  
  6362.  
  6363.  
  6364.  
  6365.  
  6366.  
  6367.  
  6368.  
  6369.  
  6370.  
  6371.  
  6372.  
  6373.  
  6374.  
  6375.  
  6376.  
  6377.  
  6378.  
  6379.  
  6380.  
  6381.  
  6382.  
  6383.  
  6384.  
  6385.  
  6386.  
  6387.  
  6388.  
  6389.  
  6390.  
  6391.  
  6392.  
  6393.  
  6394.  
  6395.  
  6396.  
  6397.  
  6398.  
  6399.  
  6400.  
  6401.  
  6402.  
  6403.  
  6404.  
  6405.  
  6406.  
  6407.  
  6408.  
  6409.  
  6410.  
  6411.  
  6412.  
  6413.  
  6414.  
  6415.  
  6416.  
  6417.  
  6418.  
  6419.  
  6420.  
  6421.  
  6422.  
  6423.  
  6424.  
  6425.  
  6426.  
  6427.  
  6428.  
  6429.  
  6430.  
  6431.  
  6432.  
  6433.  
  6434.  
  6435.  
  6436.  
  6437.  
  6438.  
  6439.  
  6440.  
  6441.  
  6442.  
  6443.  
  6444.  
  6445.  
  6446.  
  6447.  
  6448.  
  6449.  
  6450.  
  6451.  
  6452.  
  6453.  
  6454.  
  6455.  
  6456.  
  6457.  
  6458.  
  6459.  
  6460.  
  6461.  
  6462.  
  6463.  
  6464.  
  6465.  
  6466.  
  6467.  
  6468.  
  6469.  
  6470.  
  6471.  
  6472.  
  6473.  
  6474.  
  6475.  
  6476.  
  6477.  
  6478.  
  6479.  
  6480.  
  6481.  
  6482.  
  6483.  
  6484.  
  6485.  
  6486.  
  6487.  
  6488.  
  6489.  
  6490.  
  6491.  
  6492.  
  6493.  
  6494.  
  6495.  
  6496.  
  6497.  
  6498.  
  6499.  
  6500.  
  6501.  
  6502.  
  6503.  
  6504.  
  6505.  
  6506.  
  6507.  
  6508.  
  6509.  
  6510.  
  6511.  
  6512.  
  6513.  
  6514.  
  6515.  
  6516.  
  6517.  
  6518.  
  6519.  
  6520.  
  6521.  
  6522.  
  6523.  
  6524.  
  6525.  
  6526.  
  6527.  
  6528.  
  6529.  
  6530.  
  6531.  
  6532.  
  6533.  
  6534.  
  6535.  
  6536.  
  6537.  
  6538.  
  6539.  
  6540.  
  6541.  
  6542.  
  6543.  
  6544.  
  6545.  
  6546.  
  6547.  
  6548.  
  6549.  
  6550.  
  6551.  
  6552.  
  6553.  
  6554.  
  6555.  
  6556.  
  6557.  
  6558.  
  6559.  
  6560.  
  6561.  
  6562.  
  6563.  
  6564.  
  6565.  
  6566.  
  6567.  
  6568.  
  6569.  
  6570.  
  6571.  
  6572.  
  6573.  
  6574.  
  6575.  
  6576.  
  6577.  
  6578.  
  6579.  
  6580.  
  6581.  
  6582.  
  6583.  
  6584.  
  6585.  
  6586.  
  6587.  
  6588.  
  6589.  
  6590.  
  6591.  
  6592.  
  6593.  
  6594.  
  6595.  
  6596.  
  6597.  
  6598.  
  6599.  
  6600.  
  6601.  
  6602.  
  6603.  
  6604.  
  6605.  
  6606.  
  6607.  
  6608.  
  6609.  
  6610.  
  6611.  
  6612.  
  6613.  
  6614.  
  6615.  
  6616.  
  6617.  
  6618.  
  6619.  
  6620.  
  6621.  
  6622.  
  6623.  
  6624.  
  6625.  
  6626.  
  6627.  
  6628.  
  6629.  
  6630.  
  6631.  
  6632.  
  6633.  
  6634.  
  6635.  
  6636.  
  6637.  
  6638.  
  6639.  
  6640.  
  6641.  
  6642.  
  6643.  
  6644.  
  6645.  
  6646.  
  6647.  
  6648.  
  6649.  
  6650.  
  6651.  
  6652.  
  6653.  
  6654.  
  6655.  
  6656.  
  6657.  
  6658.  
  6659.  
  6660.  
  6661.  
  6662.  
  6663.  
  6664.  
  6665.  
  6666.  
  6667.  
  6668.  
  6669.  
  6670.  
  6671.  
  6672.  
  6673.  
  6674.  
  6675.  
  6676.  
  6677.  
  6678.  
  6679.  
  6680.  
  6681.  
  6682.  
  6683.  
  6684.  
  6685.  
  6686.  
  6687.  
  6688.  
  6689.  
  6690.  
  6691.  
  6692.  
  6693.  
  6694.  
  6695.  
  6696.  
  6697.  
  6698.  
  6699.  
  6700.  
  6701.  
  6702.  
  6703.  
  6704.  
  6705.  
  6706.  
  6707.  
  6708.  
  6709.  
  6710.  
  6711.  
  6712.  
  6713.  
  6714.  
  6715.  
  6716.  
  6717.  
  6718.  
  6719.  
  6720.  
  6721.  
  6722.  
  6723.  
  6724.  
  6725.  
  6726.  
  6727.  
  6728.  
  6729.  
  6730.  
  6731.  
  6732.  
  6733.  
  6734.  
  6735.  
  6736.  
  6737.  
  6738.  
  6739.  
  6740.  
  6741.  
  6742.  
  6743.  
  6744.  
  6745.  
  6746.  
  6747.  
  6748.  
  6749.  
  6750.  
  6751.  
  6752.  
  6753.  
  6754.  
  6755.  
  6756.  
  6757.  
  6758.  
  6759.  
  6760.  
  6761.  
  6762.  
  6763.  
  6764.  
  6765.  
  6766.  
  6767.  
  6768.  
  6769.  
  6770.  
  6771.  
  6772.  
  6773.  
  6774.  
  6775.  
  6776.  
  6777.  
  6778.  
  6779.  
  6780.  
  6781.  
  6782.  
  6783.  
  6784.  
  6785.  
  6786.  
  6787.  
  6788.  
  6789.  
  6790.  
  6791.  
  6792.  
  6793.  
  6794.  
  6795.  
  6796.  
  6797.  
  6798.  
  6799.  
  6800.  
  6801.  
  6802.  
  6803.  
  6804.  
  6805.  
  6806.  
  6807.  
  6808.  
  6809.  
  6810.  
  6811.  
  6812.  
  6813.  
  6814.  
  6815.  
  6816.  
  6817.  
  6818.  
  6819.  
  6820.  
  6821.  
  6822.  
  6823.  
  6824.  
  6825.  
  6826.  
  6827.  
  6828.  
  6829.  
  6830.  
  6831.  
  6832.  
  6833.  
  6834.  
  6835.  
  6836.  
  6837.  
  6838.  
  6839.  
  6840.  
  6841.  
  6842.  
  6843.  
  6844.  
  6845.  
  6846.  
  6847.  
  6848.  
  6849.  
  6850.  
  6851.  
  6852.  
  6853.  
  6854.  
  6855.  
  6856.  
  6857.  
  6858.  
  6859.  
  6860.  
  6861.  
  6862.  
  6863.  
  6864.  
  6865.  
  6866.  
  6867.  
  6868.  
  6869.  
  6870.  
  6871.  
  6872.  
  6873.  
  6874.  
  6875.  
  6876.  
  6877.  
  6878.  
  6879.  
  6880.  
  6881.  
  6882.  
  6883.  
  6884.  
  6885.  
  6886.  
  6887.  
  6888.  
  6889.  
  6890.  
  6891.  
  6892.  
  6893.  
  6894.  
  6895.  
  6896.  
  6897.  
  6898.  
  6899.  
  6900.  
  6901.  
  6902.  
  6903.  
  6904.  
  6905.  
  6906.  
  6907.  
  6908.  
  6909.  
  6910.  
  6911.  
  6912.  
  6913.  
  6914.  
  6915.  
  6916.  
  6917.  
  6918.  
  6919.  
  6920.  
  6921.  
  6922.  
  6923.  
  6924.  
  6925.  
  6926.  
  6927.  
  6928.  
  6929.  
  6930.  
  6931.  
  6932.  
  6933.  
  6934.  
  6935.  
  6936.  
  6937.  
  6938.  
  6939.  
  6940.  
  6941.  
  6942.  
  6943.  
  6944.  
  6945.  
  6946.  
  6947.  
  6948.  
  6949.  
  6950.  
  6951.  
  6952.  
  6953.  
  6954.  
  6955.  
  6956.  
  6957.  
  6958.  
  6959.  
  6960.  
  6961.  
  6962.  
  6963.  
  6964.  
  6965.  
  6966.  
  6967.  
  6968.  
  6969.  
  6970.  
  6971.  
  6972.  
  6973.  
  6974.  
  6975.  
  6976.  
  6977.  
  6978.  
  6979.  
  6980.  
  6981.  
  6982.  
  6983.  
  6984.  
  6985.  
  6986.  
  6987.  
  6988.  
  6989.  
  6990.  
  6991.  
  6992.  
  6993.  
  6994.  
  6995.  
  6996.  
  6997.  
  6998.  
  6999.  
  7000.  
  7001.  
  7002.  
  7003.  
  7004.  
  7005.  
  7006.  
  7007.  
  7008.  
  7009.  
  7010.  
  7011.  
  7012.  
  7013.  
  7014.  
  7015.  
  7016.  
  7017.  
  7018.  
  7019.  
  7020.  
  7021.  
  7022.  
  7023.  
  7024.  
  7025.  
  7026.  
  7027.  
  7028.  
  7029.  
  7030.  
  7031.  
  7032.  
  7033.  
  7034.  
  7035.  
  7036.  
  7037.  
  7038.  
  7039.  
  7040.  
  7041.  
  7042. implementation
  7043.