home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / bde.int < prev    next >
Encoding:
Text File  |  1998-02-09  |  321.4 KB  |  6,787 lines

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