home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 February / DPPCPRO0299.ISO / February / Delphi / Runimage / DELPHI20 / DOC / BDE.INT next >
Encoding:
Text File  |  1996-06-10  |  255.9 KB  |  5,230 lines

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