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