home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bde / sdkunit.pak / DBITYPES.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-07-24  |  103.7 KB  |  2,443 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       BDE Data types                                  }
  5. {                                                       }
  6. {       Copyright (c) 1995 Borland International        }
  7. {                                                       }
  8. {*******************************************************}
  9.  
  10. unit DbiTypes;
  11.  
  12. {$IFDEF VER80}
  13.   {$Z+}  { Word Sized Enums }
  14. {$ENDIF}
  15.  
  16. interface
  17.  
  18. uses Wintypes;
  19.  
  20. { sdk debug layer defines }
  21.  
  22. const
  23.   DEBUGON            = $1;
  24.   OUTPUTTOFILE       = $2;
  25.   FLUSHEVERYOP       = $8;
  26.   APPENDTOLOG        = $10;
  27.  
  28. { Constants }
  29.  
  30.   DBIMAXNAMELEN      = 31;           { Name limit (table, field etc) }
  31.   DBIMAXSPNAMELEN    = 64;           { Max stored procedure name length }
  32.   DBIMAXFLDSINKEY    = 16;           { Max fields in a key }
  33.   DBIMAXKEYEXPLEN    = 220;          { Max Key expression length }
  34.   DBIMAXEXTLEN       = 3;            { Max file extension len, not incl. dot }
  35.   DBIMAXTBLNAMELEN   = 127;          { Max table name length }
  36.   DBIMAXDRIVELEN     =   2;          { Max drive length }
  37.   DBIMAXPATHLEN      =  81;          { Max path+file name len (excluding zero termination) }
  38.   DBIMAXMSGLEN       = 127;          { Max message len (allocate 128) }
  39.   DBIMAXVCHKLEN      = 255;          { Max val check len }
  40.   DBIMAXPICTLEN      = 175;          { Max picture len   //Verify this - VJ }
  41.   DBIMAXFLDSINSEC    = 256;          { Max fields in security spec }
  42.  
  43.   DBIMAXSCFIELDS     = 16;           { max nbr of fields in a config section }
  44.   DBIMAXSCFLDLEN     = 128;          { max field length }
  45.   DBIMAXSCRECSIZE    = 2048;         { max rec size }
  46.  
  47.   DBIMAXUSERNAMELEN  = 14;           { Max user name (general) }
  48.   DBIMAXXBUSERNAMELEN = 12;          { Max user name length (xBASE) }
  49.   DBIMAXBOOKMARKLEN  = 4104;         { Max Bookmark length }
  50.  
  51. {============================================================================}
  52. {                             G e n e r a l                                  }
  53. {============================================================================}
  54.  
  55. type
  56.   DATE               = Longint;
  57.   TIME               = Longint;
  58.   TIMESTAMP          = Double;
  59.   DBIResult          = Word;         { Function result }
  60.   WordEnum           = Word;
  61.   PLocale            = Pointer;
  62.  
  63. { Handle Types }
  64.  
  65.   _hDBIObj           = record end;   { Dummy structure to create "typed" handles }
  66.   hDBIObj            = ^_hDBIObj;    { Generic object handle }
  67.   hDBIDb             = ^_hDBIObj;    { Database handle }
  68.   hDBIQry            = ^_hDBIObj;    { Query handle }
  69.   hDBIStmt           = ^_hDBIObj;    { Statement handle ("new query") }
  70.   hDBICur            = ^_hDBIObj;    { Cursor handle }
  71.   hDBISes            = ^_hDBIObj;    { Session handle }
  72.   hDBIXlt            = ^_hDBIObj;    { Translation handle }
  73.   hDBICfg            = ^_hDBIObj;    { Configuration handle }
  74.   hDBIXact           = ^_hDBIObj;    { Transaction handle }
  75.   hDBIFilter         = ^_hDBIObj;    { Filter handle }
  76.  
  77. { Handle Pointers }
  78.  
  79.   phDBIObj           = ^hDBIObj;     { Pointer to Generic object handle }
  80.   phDBIDb            = ^hDBIDb;      { Pointer to Database handle }
  81.   phDBIQry           = ^hDBIQry;     { Pointer to Query handle }
  82.   phDBIStmt          = ^hDBIStmt;    { Pointer to Statement handle }
  83.   phDBICur           = ^hDBICur;     { Pointer to Cursor handle }
  84.   phDBISes           = ^hDBISes;     { Pointer to Session handle }
  85.   phDBIXlt           = ^hDBIXlt;     { Pointer to Translation handle }
  86.   phDBICfg           = ^hDBICfg;     { Pointer to Configuration handle }
  87.   phDBIXact          = ^hDBIXact;    { Pointer to Transaction handle }
  88.   phDBIFilter        = ^hDBIFilter;  { Pointer to Filter handle }
  89.  
  90. { typedefs for buffers of various common sizes: }
  91.  
  92.   DBIPATH            = packed array [0..DBIMAXPATHLEN] of Char; { holds a DOS path }
  93.   DBINAME            = packed array [0..DBIMAXNAMELEN] of Char; { holds a name }
  94.   DBIEXT             = packed array [0..DBIMAXEXTLEN] of Char; { holds an extension EXT }
  95.   DBIDOTEXT          = packed array [0..DBIMAXEXTLEN+1] of Char; { holds an extension EXT including '.' }
  96.   DBIDRIVE           = packed array [0..DBIMAXDRIVELEN] of Char; { holds a drive name }
  97.   DBITBLNAME         = packed array [0..DBIMAXTBLNAMELEN] of Char; { holds a table name }
  98.   DBISPNAME          = packed array [0..DBIMAXSPNAMELEN] of Char; { holds a stored procedure name }
  99.   DBIUSERNAME        = packed array [0..DBIMAXUSERNAMELEN] of Char; { holds a user name }
  100.   DBIKEY             = packed array [0..DBIMAXFLDSINKEY - 1] of Word; { holds list of fields in a key }
  101.   DBIKEYEXP          = packed array [0..DBIMAXKEYEXPLEN] of Char; { holds a key expression }
  102.   DBIVCHK            = packed array [0..DBIMAXVCHKLEN] of Byte; { holds a validity check }
  103.   DBIPICT            = packed array [0..DBIMAXPICTLEN] of Char; { holds a picture (Pdox) }
  104.   DBIMSG             = packed array [0..DBIMAXMSGLEN] of Char; { holds an error message }
  105.  
  106.  
  107. {============================================================================}
  108. {                             Environmental                                  }
  109. {============================================================================}
  110.  
  111. type
  112.   pDBIEnv = ^DBIEnv;
  113.   DBIEnv = packed record             { Struct for defining the environ. }
  114.     szWorkDir       : DBIPATH;       { Working directory }
  115.     szIniFile       : DBIPATH;       { Configuration file }
  116.     bForceLocalInit : WordBool;      { Force local initialization }
  117.     szLang          : DBINAME;       { System language driver }
  118.     szClientName    : DBINAME;       { Client name }
  119.   end;
  120.  
  121. {============================================================================}
  122. {                   System Info                                              }
  123. {============================================================================}
  124.  
  125. type
  126.   pSYSVersion = ^SYSVersion;
  127.   SYSVersion = packed record         { System Version Info }
  128.     iVersion        : Word;          { Engine version }
  129.     iIntfLevel      : Word;          { Client Interface level }
  130.     dateVer         : Date;          { Version date (Compile/Release) }
  131.     timeVer         : Time;          { Version time (Compile/Release) }
  132.   end;
  133.  
  134.   pSYSConfig = ^SYSConfig;
  135.   SYSConfig = packed record          { System configuration (basic) }
  136.     bLocalShare     : WordBool;      { If Local files will be shared }
  137.     iNetProtocol    : Word;          { Net Protocol (35, 40 etc.) }
  138.     bNetShare       : WordBool;      { True if connected to network }
  139.     szNetType       : DBINAME;       { Network type }
  140.     szUserName      : DBIUSERNAME;   { Network user name }
  141.     szIniFile       : DBIPATH;       { Configuration file }
  142.     szLangDriver    : DBINAME;       { System language driver }
  143.   end;
  144.  
  145.   pSYSInfo = ^SYSInfo;
  146.   SYSInfo = packed record            { System Status/Info }
  147.     iBufferSpace    : Word;          { in K }
  148.     iHeapSpace      : Word;          { in K }
  149.     iDrivers        : Word;          { Active/Loaded drivers }
  150.     iClients        : Word;          { Active clients }
  151.     iSessions       : Word;          { Number of sessions (For all clients) }
  152.     iDatabases      : Word;          { Open databases }
  153.     iCursors        : Word;          { Number of cursors }
  154.   end;
  155.  
  156.   pCLIENTInfo = ^CLIENTInfo;
  157.   CLIENTInfo = packed record
  158.     szName          : DBINAME;       { Documentary name }
  159.     iSessions       : Word;          { Number of sessions }
  160.     szWorkDir       : DBIPATH;       { Working directory }
  161.     szLang          : DBINAME;       { System language driver (Client supplied) }
  162.   end;
  163.  
  164.   pSESInfo = ^SESInfo;
  165.   SESInfo = packed record
  166.     iSession        : Word;          { Session id (1..n) }
  167.     szName          : DBINAME;       { Documentary name }
  168.     iDatabases      : Word;          { Open databases }
  169.     iCursors        : Word;          { Open cursors }
  170.     iLockWait       : Integer;       { Lock wait time (in seconds) }
  171.     szNetDir        : DBIPATH;       { Net directory location }
  172.     szPrivDir       : DBIPATH;       { Current Private directory }
  173.   end;
  174.  
  175. {============================================================================}
  176. {                             Table / Field Types                            }
  177. {============================================================================}
  178.  
  179. { Driver Types }
  180.  
  181. const
  182.   szPARADOX          = 'PARADOX';
  183.   szDBASE            = 'DBASE';
  184.   szASCII            = 'ASCIIDRV';
  185.  
  186.  
  187. { Field Types (Logical) }
  188.  
  189.   fldUNKNOWN         = 0;
  190.   fldZSTRING         = 1;            { Null terminated string }
  191.   fldDATE            = 2;            { Date     (32 bit) }
  192.   fldBLOB            = 3;            { Blob }
  193.   fldBOOL            = 4;            { Boolean  (16 bit) }
  194.   fldINT16           = 5;            { 16 bit signed number }
  195.   fldINT32           = 6;            { 32 bit signed number }
  196.   fldFLOAT           = 7;            { 64 bit floating point }
  197.   fldBCD             = 8;            { BCD }
  198.   fldBYTES           = 9;            { Fixed number of bytes }
  199.   fldTIME            = 10;           { Time        (32 bit) }
  200.   fldTIMESTAMP       = 11;           { Time-stamp  (64 bit) }
  201.   fldUINT16          = 12;           { Unsigned 16 bit integer }
  202.   fldUINT32          = 13;           { Unsigned 32 bit integer }
  203.   fldFLOATIEEE       = 14;           { 80-bit IEEE float }
  204.   fldVARBYTES        = 15;           { Length prefixed var bytes }
  205.   fldLOCKINFO        = 16;           { Look for LOCKINFO typedef }
  206.  
  207.   MAXLOGFLDTYPES     = 17;           { Number of logical fieldtypes }
  208.  
  209. { Sub Types }
  210.  
  211. { fldFLOAT subtype }
  212.  
  213.   fldstMONEY         = 21;           { Money }
  214.  
  215. { fldBLOB subtypes }
  216.  
  217.   fldstMEMO          = 22;           { Text Memo }
  218.   fldstBINARY        = 23;           { Binary data }
  219.   fldstFMTMEMO       = 24;           { Formatted Text }
  220.   fldstOLEOBJ        = 25;           { OLE object (Paradox) }
  221.   fldstGRAPHIC       = 26;           { Graphics object }
  222.   fldstDBSOLEOBJ     = 27;           { dBASE OLE object }
  223.   fldstTYPEDBINARY   = 28;           { Typed Binary data }
  224.  
  225. { fldZSTRING subtype }
  226.  
  227.   fldstPASSWORD      = 1;            { Password }
  228.  
  229. { fldINT32 subtype }
  230.  
  231.   fldstAUTOINC       = 29;
  232.  
  233. { Paradox types (Physical) }
  234.  
  235.   fldPDXCHAR         = $101;         { Alpha    (string) }
  236.   fldPDXNUM          = $102;         { Numeric     }
  237.   fldPDXMONEY        = $103;         { Money }
  238.   fldPDXDATE         = $104;         { Date }
  239.   fldPDXSHORT        = $105;         { Short }
  240.   fldPDXMEMO         = $106;         { Text Memo       (blob) }
  241.   fldPDXBINARYBLOB   = $107;         { Binary data     (blob) }
  242.   fldPDXFMTMEMO      = $108;         { Formatted text  (blob) }
  243.   fldPDXOLEBLOB      = $109;         { OLE object      (blob) }
  244.   fldPDXGRAPHIC      = $10A;         { Graphics object (blob) }
  245.   fldPDXBLOB         = fldPDXMEMO;
  246.   fldPDXLONG         = $10B;         { Long }
  247.   fldPDXTIME         = $10C;         { Time }
  248.   fldPDXDATETIME     = $10D;         { Time Stamp }
  249.   fldPDXBOOL         = $10E;         { Logical }
  250.   fldPDXAUTOINC      = $10F;         { Auto increment (long) }
  251.   fldPDXBYTES        = $110;         { Fixed number of bytes }
  252.   fldPDXBCD          = $111;         { BCD (32 digits) }
  253.   fldPDXUNICHAR      = $112;         { not supported yet }
  254.  
  255. { xBASE types (Physical) }
  256.  
  257.   fldDBCHAR          = $201;         { Char string }
  258.   fldDBNUM           = $202;         { Number }
  259.   fldDBMEMO          = $203;         { Memo          (blob) }
  260.   fldDBBOOL          = $204;         { Logical }
  261.   fldDBDATE          = $205;         { Date }
  262.   fldDBFLOAT         = $206;         { Float }
  263.   fldDBLOCK          = $207;         { Logical type is LOCKINFO }
  264.   fldDBOLEBLOB       = $208;         { OLE object    (blob) }
  265.   fldDBBINARY        = $209;         { Binary data   (blob) }
  266.   fldDBBYTES         = $20A;         { Only for TEMPORARY tables }
  267.  
  268. { xBASE key types (Cannot be used as field types) }
  269.  
  270.   fldDBKEYNUM        = $210;
  271.   fldDBKEYBCD        = $211;
  272.  
  273.  
  274. { Ascii types (Physical) }
  275.  
  276.   fldASCCHAR         = $301;         { Char string }
  277.   fldASCNUM          = $302;         { Number }
  278.   fldASCBOOL         = $303;         { Logical }
  279.   fldASCDATE         = $304;         { Date }
  280.   fldASCFLOAT        = $305;         { Float }
  281.   fldASCLOCK         = $306;         { Not used }
  282.   fldASCTIMESTAMP    = $307;         { TimeStamp }
  283.   fldASCTIME         = $308;         { Time }
  284.   fldASCLONG         = $309;         { Long }
  285.   fldASCMONEY        = $30A;         { Money }
  286.  
  287.  
  288. {============================================================================}
  289. {                    Field descriptor                                        }
  290. {============================================================================}
  291.  
  292.  
  293. type
  294. {$IFDEF VER80}
  295.   FLDVchk = (                        { Field Val Check type }
  296.     fldvNOCHECKS,                    { Does not have explicit val checks }
  297.     fldvHASCHECKS,                   { One or more val checks on the field }
  298.     fldvUNKNOWN                      { Dont know at this time }
  299.   );
  300.  
  301. type
  302.   FLDRights = (                      { Field Rights }
  303.     fldrREADWRITE,                   { Field can be Read/Written }
  304.     fldrREADONLY,                    { Field is Read only }
  305.     fldrNONE,                        { No Rights on this field }
  306.     fldrUNKNOWN                      { Dont know at this time }
  307.   );
  308. {$ELSE}
  309.   FLDVchk = WordEnum;                { Field Val Check type }
  310. const
  311.     fldvNOCHECKS   = 0;              { Does not have explicit val checks }
  312.     fldvHASCHECKS  = 1;              { One or more val checks on the field }
  313.     fldvUNKNOWN    = 2;              { Dont know at this time }
  314.  
  315. type
  316.   FLDRights = WordEnum;              { Field Rights }
  317. const
  318.     fldrREADWRITE = 0;               { Field can be Read/Written }
  319.     fldrREADONLY  = 1;               { Field is Read only }
  320.     fldrNONE      = 2;               { No Rights on this field }
  321.     fldrUNKNOWN   = 3;               { Dont know at this time }
  322. {$ENDIF}
  323.  
  324. type
  325.   pFLDDesc = ^FLDDesc;
  326.   FLDDesc = packed record            { Field Descriptor }
  327.     iFldNum         : Word;          { Field number (1..n) }
  328.     szName          : DBINAME;       { Field name }
  329.     iFldType        : Word;          { Field type }
  330.     iSubType        : Word;          { Field subtype (if applicable) }
  331.     iUnits1         : Integer;       { Number of Chars, digits etc }
  332.     iUnits2         : Integer;       { Decimal places etc. }
  333.     iOffset         : Word;          { Offset in the record (computed) }
  334.     iLen            : Word;          { Length in bytes (computed) }
  335.     iNullOffset     : Word;          { For Null bits (computed) }
  336.     efldvVchk       : FLDVchk;       { Field Has vcheck (computed) }
  337.     efldrRights     : FLDRights;     { Field Rights (computed) }
  338.   end;
  339.  
  340. {============================================================================}
  341. {                    Index descriptor                                        }
  342. {============================================================================}
  343.  
  344. type
  345.   pIDXDesc = ^IDXDesc;
  346.   IDXDesc = packed record            { Index description }
  347.     szName          : DBITBLNAME;    { Index name }
  348.     iIndexId        : Word;          { Index number }
  349.     szTagName       : DBINAME;       { Tag name (for dBASE) }
  350.     szFormat        : DBINAME;       { Optional format (BTREE, HASH etc) }
  351.     bPrimary        : WordBool;      { True, if primary index }
  352.     bUnique         : WordBool;      { True, if unique keys }
  353.     bDescending     : WordBool;      { True, for descending index }
  354.     bMaintained     : WordBool;      { True, if maintained index }
  355.     bSubset         : WordBool;      { True, if subset index }
  356.     bExpIdx         : WordBool;      { True, if expression index }
  357.     iCost           : Word;          { Not used }
  358.     iFldsInKey      : Word;          { Fields in the key (1 for Exp) }
  359.     iKeyLen         : Word;          { Phy Key length in bytes (Key only) }
  360.     bOutofDate      : WordBool;      { True, if index out of date }
  361.     iKeyExpType     : Word;          { Key type of Expression }
  362.     aiKeyFld        : DBIKEY;        { Array of field numbers in key }
  363.     szKeyExp        : DBIKEYEXP;     { Key expression }
  364.     szKeyCond       : DBIKEYEXP;     { Subset condition }
  365.     bCaseInsensitive : WordBool;     { True, if case insensitive index }
  366.     iBlockSize      : Word;          { Block size in bytes }
  367.     iRestrNum       : Word;          { Restructure number }
  368.     iUnUsed         : packed array [0..15] of Word;
  369.   end;
  370.  
  371. {============================================================================}
  372. {             Validity check, Referential integrity descriptors              }
  373. {============================================================================}
  374.  
  375.  
  376.  
  377. { Subtypes for Lookup }
  378.  
  379. {$IFDEF VER80}
  380.   LKUPType = (                       { Paradox Lookup type }
  381.     lkupNONE,                        { Has no lookup }
  382.     lkupPRIVATE,                     { Just Current Field + Private }
  383.     lkupALLCORRESP,                  { All Corresponding + No Help }
  384.     lkupHELP,                        { Just Current Fld + Help and Fill }
  385.     lkupALLCORRESPHELP               { All Corresponging + Help }
  386.   );
  387.  
  388.   RINTType = (                       { Ref integrity type }
  389.     rintMASTER,                      { This table is Master }
  390.     rintDEPENDENT                    { This table is Dependent }
  391.   );
  392.  
  393.   RINTQual = (                       { Ref integrity action/qualifier }
  394.     rintRESTRICT,                    { Prohibit operation }
  395.     rintCASCADE                      { Cascade operation }
  396.   );
  397. {$ELSE}
  398.   LKUPType = WordEnum;               { Paradox Lookup type }
  399. const
  400.     lkupNONE            = 0;         { Has no lookup }
  401.     lkupPRIVATE         = 1;         { Just Current Field + Private }
  402.     lkupALLCORRESP      = 2;         { All Corresponding + No Help }
  403.     lkupHELP            = 3;         { Just Current Fld + Help and Fill }
  404.     lkupALLCORRESPHELP  = 4;         { All Corresponging + Help }
  405.  
  406. type
  407.   RINTType = WordEnum;               { Ref integrity type }
  408. const
  409.     rintMASTER          = 0;         { This table is Master }
  410.     rintDEPENDENT       = 1;         { This table is Dependent }
  411.  
  412. type
  413.   RINTQual = WordEnum;               { Ref integrity action/qualifier }
  414. const
  415.     rintRESTRICT        = 0;         { Prohibit operation }
  416.     rintCASCADE         = 1;         { Cascade operation }
  417. {$ENDIF}
  418.  
  419. const
  420.   TODAYVAL              = 2;         { for Min/Max/Def val flags }
  421.  
  422.    { In VCHKDesc below, if any of bHasMinVal/bHasMaxVal/bHasDefVal }
  423.    { = TODAYVAL, then TODAY is assumed.                            }
  424.  
  425. type
  426.   pVCHKDesc = ^VCHKDesc;
  427.   VCHKDesc = packed record           { Val Check structure }
  428.     iFldNum         : Word;          { Field number }
  429.     bRequired       : WordBool;      { If True, value is required }
  430.     bHasMinVal      : WordBool;      { If True, has min value }
  431.     bHasMaxVal      : WordBool;      { If True, has max value }
  432.     bHasDefVal      : WordBool;      { If True, has default value }
  433.     aMinVal         : DBIVCHK;       { Min Value }
  434.     aMaxVal         : DBIVCHK;       { Max Value }
  435.     aDefVal         : DBIVCHK;       { Default value }
  436.     szPict          : DBIPICT;       { Picture string }
  437.     elkupType       : LKUPType;      { Lookup/Fill type }
  438.     szLkupTblName   : DBIPATH;       { Lookup Table name }
  439.   end;
  440.  
  441.   pRINTDesc = ^RINTDesc;
  442.   RINTDesc = packed record           { Ref Integrity Desc }
  443.     iRintNum        : Word;          { Ref integrity number }
  444.     szRintName      : DBINAME;       { A name to tag this integegrity constraint }
  445.     eType           : RINTType;      { Whether master/dependent }
  446.     szTblName       : DBIPATH;       { Other table name }
  447.     eModOp          : RINTQual;      { Modify qualifier }
  448.     eDelOp          : RINTQual;      { Delete qualifier }
  449.     iFldCount       : Word;          { Fields in foreign key }
  450.     aiThisTabFld    : DBIKEY;        { Fields in this table }
  451.     aiOthTabFld     : DBIKEY;        { Fields in other table }
  452.   end;
  453.  
  454.  
  455. {============================================================================}
  456. {                    Security descriptor                                     }
  457. {============================================================================}
  458. { Family rights }
  459.  
  460. const
  461.   NOFAMRIGHTS        = $00;          { No Family rights }
  462.   FORMRIGHTS         = $01;          { Can change form }
  463.   RPTRIGHTS          = $02;          { Can change reports }
  464.   VALRIGHTS          = $04;          { Can change valchecks }
  465.   SETRIGHTS          = $08;          { Can change settings }
  466.   ALLFAMRIGHTS       = (FORMRIGHTS or RPTRIGHTS or VALRIGHTS or SETRIGHTS);
  467.                                              { All family rights }
  468.  
  469. type
  470.   PRVType = WordEnum;
  471. const
  472.     prvNONE      = 0;                { No privilege }
  473.     prvREADONLY  = 1;                { Read only Table or Field }
  474.     prvMODIFY    = 3;                { Read and Modify fields (non-key) }
  475.     prvINSERT    = 7;                { Insert + All of above }
  476.     prvINSDEL    = $0F;              { Delete + All of above }
  477.     prvFULL      = $1F;              { Full Writes }
  478.     prvUNKNOWN   = $FF;              { Unknown }
  479.  
  480.  
  481. type
  482.   pSECDesc = ^SECDesc;
  483.   SECDesc = packed record            { Security description }
  484.     iSecNum         : Word;          { Nbr to identify desc }
  485.     eprvTable       : Word;          { Table privileges }
  486.     iFamRights      : Word;          { Family rights }
  487.     szPassword      : DBINAME;       { Null terminated string }
  488.     aprvFld         : packed array [0..DBIMAXFLDSINSEC-1] of Word;
  489.                      { Field level privileges (prvNONE/prvREADONLY/prvFULL) }
  490.   end;
  491.  
  492. {============================================================================}
  493. {                         Miscellaneous                                      }
  494. {============================================================================}
  495.  
  496. { Index Id used to open table without a default index (i.e. no order) }
  497.  
  498. const
  499.   NODEFAULTINDEX     = $FFFF;
  500.  
  501.  
  502. {============================================================================}
  503. {                    Object types                                            }
  504. {============================================================================}
  505.  
  506. type
  507. {$IFDEF VER80}
  508.   DBIOBJType = (
  509.     objFILLER,                       { Filler to make next start at 1 }
  510.     objSYSTEM,                       { System object }
  511.     objSESSION,                      { Session object }
  512.     objDRIVER,                       { Driver object }
  513.     objDATABASE,                     { Database object }
  514.     objCURSOR,                       { Cursor object }
  515.     objSTATEMENT,                    { Statement object }
  516.     objCLIENT,                       { Client object }
  517.     objDBSEC                         { DbSystem object (dBASE only) }
  518.   );
  519. {$ELSE}
  520.   DBIOBJType = WordEnum;
  521. const
  522.     objSYSTEM    = 1;                { System object }
  523.     objSESSION   = 2;                { Session object }
  524.     objDRIVER    = 3;                { Driver object }
  525.     objDATABASE  = 4;                { Database object }
  526.     objCURSOR    = 5;                { Cursor object }
  527.     objSTATEMENT = 6;                { Statement object }
  528.     objCLIENT    = 7;                { Client object }
  529.     objDBSEC     = 8;                { DbSystem object (dBASE only) }
  530. {$ENDIF}
  531.  
  532. {============================================================================}
  533. {                    Cursor properties                                       }
  534. {============================================================================}
  535.  
  536. type
  537. {$IFDEF VER80}
  538.   DBIShareMode = (                   { Database/Table Share type }
  539.     dbiOPENSHARED,                   { Open shared  (Default) }
  540.     dbiOPENEXCL                      { Open exclusive }
  541.   );
  542.  
  543.   DBIOpenMode = (                    { Database/Table Access type }
  544.     dbiREADWRITE,                    { Read + Write   (Default) }
  545.     dbiREADONLY                      { Read only }
  546.   );
  547.  
  548.   DBILockType = (                    { Lock types (Table level) }
  549.     dbiNOLOCK,                       { No lock   (Default) }
  550.     dbiWRITELOCK,                    { Write lock }
  551.     dbiREADLOCK                      { Read lock }
  552.   );
  553.  
  554.   XLTMode = (                        { Field translate mode }
  555.     xltNONE,                         { No translation  (Physical Types) }
  556.     xltRECORD,                       { Record level translation (not supported) }
  557.     xltFIELD                         { Field level translation (Logical types) }
  558.   );
  559.  
  560.   UPDLockMode = (                    { Update lock mode (SQL only) }
  561.     updWHEREALL,                     { All fields in WHERE clause }
  562.     updWHEREKEYCHG,                  { Key and changed fields in WHERE clause }
  563.     updWHEREKEY                      { Key fields in WHERE clause }
  564.   );
  565.  
  566. {$ELSE}
  567.   DBIShareMode = WordEnum;           { Database/Table Share type }
  568. const
  569.     dbiOPENSHARED = 0;               { Open shared  (Default) }
  570.     dbiOPENEXCL   = 1;               { Open exclusive }
  571.  
  572. type
  573.   DBIOpenMode = WordEnum;            { Database/Table Access type }
  574. const
  575.     dbiREADWRITE  = 0;               { Read + Write   (Default) }
  576.     dbiREADONLY   = 1;               { Read only }
  577.  
  578. type
  579.   DBILockType = WordEnum;            { Lock types (Table level) }
  580. const
  581.     dbiNOLOCK     = 0;               { No lock   (Default) }
  582.     dbiWRITELOCK  = 1;               { Write lock }
  583.     dbiREADLOCK   = 2;               { Read lock }
  584.  
  585. type
  586.   XLTMode = WordEnum;                { Field translate mode }
  587. const
  588.     xltNONE       = 0;               { No translation  (Physical Types) }
  589.     xltRECORD     = 1;               { Record level translation (not supported) }
  590.     xltFIELD      = 2;               { Field level translation (Logical types) }
  591.  
  592. type
  593.   UPDLockMode     = WordEnum;        { Update lock mode (SQL only) }
  594. const
  595.     updWHEREALL   = 0;               { All fields in WHERE clause }
  596.     updWHEREKEYCHG= 1;               { Key and changed fields in WHERE clause }
  597.     updWHEREKEY   = 2;               { Key fields in WHERE clause }
  598.  
  599. {$ENDIF}
  600.  
  601. { Table Levels }
  602.  
  603. const
  604.   TBLLEVEL3          = 3;            { Paradox level 3 and dBASE level 3+ }
  605.   TBLLEVEL4          = 4;            { Paradox level 4 and dBASE level 4 }
  606.   TBLLEVEL5          = 5;            { Paradox level 5 and dBASE/Win }
  607.   FOXLEVEL25         = 25;           { Fox Table (Ver 2.5) }
  608.  
  609.  
  610.  
  611. type
  612.   pCURProps = ^CURProps;
  613.   CURProps = packed record           { Virtual Table properties }
  614.     szName          : DBITBLNAME;    { table name (no extension, if it can be derived) }
  615.     iFNameSize      : Word;          { Full file name size }
  616.     szTableType     : DBINAME;       { Driver type }
  617.     iFields         : Word;          { No of fields in Table }
  618.     iRecSize        : Word;          { Record size (logical record) }
  619.     iRecBufSize     : Word;          { Record size (physical record) }
  620.     iKeySize        : Word;          { Key size }
  621.     iIndexes        : Word;          { Number of indexes }
  622.     iValChecks      : Word;          { Number of val checks }
  623.     iRefIntChecks   : Word;          { Number of Ref Integrity constraints }
  624.     iBookMarkSize   : Word;          { Bookmark size }
  625.     bBookMarkStable : WordBool;      { Stable book marks }
  626.     eOpenMode       : DBIOpenMode;   { ReadOnly / RW }
  627.     eShareMode      : DBIShareMode;  { Excl / Share }
  628.     bIndexed        : WordBool;      { Index is in use }
  629.     iSeqNums        : Integer;       { 1: Has Seqnums; 0: Has Record# }
  630.     bSoftDeletes    : WordBool;      { Supports soft deletes }
  631.     bDeletedOn      : WordBool;      { If above, deleted recs seen }
  632.     iRefRange       : Word;          { Not used }
  633.     exltMode        : XLTMode;       { Translate Mode }
  634.     iRestrVersion   : Word;          { Restructure version number }
  635.     bUniDirectional : WordBool;      { Cursor is uni-directional }
  636.     eprvRights      : Word;          { Table  rights }
  637.     iFmlRights      : Word;          { Family rights      }
  638.     iPasswords      : Word;          { Number of Aux passwords }
  639.     iCodePage       : Word;          { Codepage (0 if unknown) }
  640.     bProtected      : WordBool;      { Table is protected by password }
  641.     iTblLevel       : Word;          { Driver dependent table level }
  642.     szLangDriver    : DBINAME;       { Language driver name }
  643.     bFieldMap       : WordBool;      { Field map active }
  644.     iBlockSize      : Word;          { Physical file blocksize in K }
  645.     bStrictRefInt   : WordBool;      { Strict referential integrity }
  646.     iFilters        : Word;          { Number of filters }
  647.     bTempTable      : WordBool;      { Table is a temporary table }
  648.     iUnUsed         : packed array [0..15] of Word;
  649.   end;
  650.  
  651. {============================================================================}
  652. {                   Record Properties                                        }
  653. {============================================================================}
  654.  
  655. type
  656.   pRECProps = ^RECProps;
  657.   RECProps = packed record           { Record properties }
  658.     iSeqNum         : Longint;       { When Seq# supported only }
  659.     iPhyRecNum      : Longint;       { When Phy Rec#s supported only }
  660.     bRecChanged     : WordBool;      { Not used }
  661.     bSeqNumChanged  : WordBool;      { Not used }
  662.     bDeleteFlag     : WordBool;      { When soft delete supported only }
  663.   end;
  664.  
  665.  
  666. {============================================================================}
  667. {                   General properties  DbiGetProp/DbiSetProp                }
  668. {============================================================================}
  669.  
  670.  
  671. { Cursor properties }
  672. { General           }
  673. const
  674.   curMAXPROPS        = $00050000;    { ro UINT16   , Number of defined properties }
  675.   curTABLENAME       = $00050001;    { ro pTBLNAME , Table name }
  676.   curTABLETYPE       = $00050002;    { ro pDBINAME , Table type }
  677.   curTABLELEVEL      = $00050003;    { ro UINT16   , Table level 1..n }
  678.   curFILENAME        = $00050004;    { ro pPATH    , Full filename }
  679.   curXLTMODE         = $00050005;    { rw XLTMode  , Translate mode }
  680.   curSEQREADON       = $00050006;    { rw BOOL     , Sequential read mode hint ON }
  681.   curONEPASSON       = $00050007;    { rw BOOL     , One pass mode hint ON }
  682.   curUPDATETS        = $00050008;    { ro TIMESTAMP, Update timestamp }
  683.   curSOFTDELETEON    = $00050009;    { rw BOOL     , Softdelete ON }
  684.   curLANGDRVNAME     = $0005000A;    { ro pCHAR    , Symbolic language drv. name }
  685.   curCURSORNAME      = $0005000B;    { ro pCHAR    , name of the cursor }
  686.   maxcurPROPS        = 11;           { keep in sync when adding cursor properties }
  687.  
  688. { Paradox specific }
  689.   curPDXMAXPROPS     = $01050000;    { ro UINT16   , Number of defined properties }
  690.   maxcurPDXPROPS     = 0;
  691.  
  692. { DBase specific }
  693.   curDBMAXPROPS      = $02050000;    { ro UINT16   , Number of defined properties }
  694.   curINEXACTON       = $02050001;    { rw BOOL     , InExact match ON }
  695.   curSHAREMODE       = $02050002;    { rw DBIShareMode, Share mode }
  696.   maxcurDBPROPS      = 2;
  697.  
  698. { Text Driver specific }
  699.   curDELIMITALLFLDS  = $03050000;    { rw BOOL , Delimit all fields. }
  700.   curUSESCHEMAFILE   = $03050001;    { rw BOOL , read schema from a file }
  701.  
  702. { SQL Driver specific }
  703.   curUPDLOCKMODE     = $04050000;    { rw UPDLockMode ,Update lock mode }
  704.   curNATIVEHNDL      = $04050001;    { ro pBYTE       ,Native cursor handle }
  705.  
  706. { Driver properties }
  707. { General           }
  708.   drvMAXPROPS        = $00030000;    { ro UINT16   , Number of defined properties }
  709.   drvDRIVERTYPE      = $00030002;    { ro pDBINAME , Driver type }
  710.   drvDRIVERVERSION   = $00030003;    { ro UINT16   , Driver version }
  711.   maxdrvPROPS        = 2;            { keep in sync when adding driver properties }
  712.  
  713. { Database properties }
  714. { General             }
  715.   dbMAXPROPS         = $00040000;    { ro UINT16   , Number of defined properties }
  716.   dbDATABASENAME     = $00040001;    { ro pDBINAME , Database name/alias }
  717.   dbDATABASETYPE     = $00040002;    { ro pDBINAME , Database type }
  718.   dbDEFAULTDRIVER    = $00040003;    { rw pDBINAME , Default Driver name }
  719.   dbPARAMFMTQMARK    = $00040004;    { rw BOOL     , Stmt param marker fmt = ? }
  720.   dbUSESCHEMAFILE    = $00040005;    { rw BOOL , for text driver only. }
  721.   maxdbPROPS         = 10;           { keep in sync when adding ANY db properties }
  722.  
  723. { SQL Driver specific }
  724.   dbASYNCSUPPORT     = $04040000;    { ro BOOL     , Async. qry exec support }
  725.   dbPROCEDURES       = $04040001;    { ro BOOL     , Stored procedure support }
  726.   dbDEFAULTTXNISO    = $04040002;    { ro eXILType , Default transaction iso level }
  727.   dbNATIVEHNDL       = $04040003;    { ro pBYTE    , Native connection handle }
  728.   dbNATIVEPASSTHRUHNDL = $04040004;  { ro pBYTE    , Native passthru connection handle }
  729.   dbSERVERVERSION    = $04040005;    { ro UINT16   , Major server version number }
  730.  
  731. { Session properties }
  732. { General            }
  733.   sesMAXPROPS        = $00020000;    { ro UINT16   , Number of defined properties }
  734.   sesSESSIONNAME     = $00020001;    { ro pDBINAME , Name of seesion }
  735.   sesNETFILE         = $00020002;    { rw pCHAR    , Full filename of netfile (MAXPATHLEN) }
  736.   sesCFGMODE         = $00020003;    { rw CFGMode, Mode of configuration file. }
  737.   sesDEFAULTDRIVER   = $00020004;    { rw pDBINAME, default driver name }
  738.   sesGROUPNAME       = $00020005;    { rw pCHAR, Security - user group name (dBASE) }
  739.   sesUSERNAME        = $00020006;    { rw pCHAR, User Name }
  740.   sesUSERPASSWORD    = $00020007;    { rw pCHAR, User password }
  741.   sesSECFILENAME     = $00020008;    { rw pCHAR, Location of dBASE Security file }
  742.   maxsesPROPS        = 8;            { keep in sync when adding session properties }
  743.  
  744.  
  745. { System properties }
  746. { General           }
  747.   sysMAXPROPS        = $00010000;    { ro UINT16  , Number of defined properties }
  748.   sysLOWMEMUSAGE     = $00010001;    { ro UINT16  , Low memory usage in (k) }
  749.   maxsysPROPS        = 1;            { keep in sync when adding system properties }
  750.  
  751.  
  752. { Statement properties }
  753. { General              }
  754.   stmtMAXPROPS       = $00060001;    { ro UINT16      Number of defined properties }
  755.   stmtPARAMETERCOUNT = $00060002;    { ro UINT16      Count of parameters }
  756.   stmtPARAMETERDESCS = $00060003;    { ro aFLDDesc    Array of parameters }
  757.   stmtLANGDRVNAME    = $00060004;    { ro pCHAR       Symbolic language drv. name }
  758.   stmtUNIDIRECTIONAL = $00060010;    { rw BOOL        Cursor Unidirectional }
  759.   stmtCURSORNAME     = $00060011;    { rw pCHAR       Cursor name }
  760.   stmtNEWCONNECT     = $00060012;    { rw BOOL        Stmt on new connection }
  761.   stmtNATIVEHNDL     = $00060013;    { ro pBYTE       Native statement handle }
  762.   stmtROWCOUNT       = $00060014;    { ro UINT32      Rows effected by a stmt }
  763.   maxstmtPROPS       = 19;           { keep in sync when adding ANY stmt properties }
  764.  
  765. { specific to QBE or local SQL }
  766.   stmtANSTYPE        = $00060020;    { rw pBYTE       Table Type of Answer set }
  767.   stmtLIVENESS       = $00060021;    { rw LIVENESS    Preference for canned/live answers }
  768.   stmtQRYMODE        = $00060022;    { rw QryEvalMode Execute on server or local or either }
  769.   stmtBLANKS         = $00060023;    { rw BOOL        True if blanks to be regarded as zeros. }
  770.   stmtDATEFORMAT     = $00060024;    { rw FMTDate     Date format }
  771.   stmtNUMBERFORMAT   = $00060025;    { rw FMTNumber   Number format }
  772.   stmtAUXTBLS        = $00060026;    { rw BOOL        True if QBE to create CHANGED, etc. }
  773.   stmtTBLVECTOR      = $00060027;    { ro UINT16      Vector of tables generated by query. }
  774.   stmtALLPROPS       = $00060028;    { rw QueryLowProps }
  775.   stmtALLPROPSSIZE   = $00060029;    { rw INT16       size of QueryLowProps }
  776.   stmtANSNAME        = $00060030;    { rw pBYTE       Answer Table Name. }
  777.  
  778.  
  779. {============================================================================}
  780. {                    Transactions                                            }
  781. {============================================================================}
  782.  
  783. { Transaction support }
  784.  
  785. type
  786. {$IFDEF VER80}
  787.   eXILType = (                       { Transaction isolation levels }
  788.     xilDIRTYREAD,                    { Uncommitted changes read }
  789.     xilREADCOMMITTED,                { Committed changes, no phantoms }
  790.     xilREPEATABLEREAD                { Full read repeatability }
  791.   );
  792.  
  793.   eXEnd = (                          { Transaction end control }
  794.     xendCOMMIT,                      { Commit transaction }
  795.     xendCOMMITKEEP,                  { Commit transaction, keep cursors }
  796.     xendABORT                        { Rollback transaction }
  797.   );
  798.  
  799.   eXState = (                        { Transaction end control }
  800.     xsINACTIVE,                      { Transaction inactive }
  801.     xsACTIVE                         { Transaction active }
  802.   );
  803. {$ELSE}
  804.   eXILType = WordEnum;               { Transaction isolation levels }
  805. const
  806.     xilDIRTYREAD      = 0;           { Uncommitted changes read }
  807.     xilREADCOMMITTED  = 1;           { Committed changes, no phantoms }
  808.     xilREPEATABLEREAD = 2;           { Full read repeatability }
  809.  
  810. type
  811.   eXEnd = WordEnum;                  { Transaction end control }
  812. const
  813.     xendCOMMIT        = 0;           { Commit transaction }
  814.     xendCOMMITKEEP    = 1;           { Commit transaction, keep cursors }
  815.     xendABORT         = 2;           { Rollback transaction }
  816.  
  817. type
  818.   eXState = WordEnum;                { Transaction end control }
  819. const
  820.     xsINACTIVE        = 0;           { Transaction inactive }
  821.     xsACTIVE          = 1;           { Transaction active }
  822. {$ENDIF}
  823.  
  824. type
  825.   pXInfo = ^XInfo;
  826.   XInfo = packed record
  827.     exState         : eXState;       { xsActive, xsInactive }
  828.     eXIL            : eXILType;      { Xact isolation level }
  829.     uNests          : Word;          { Xact children }
  830.   end;
  831.  
  832.  
  833. {============================================================================}
  834. {                         BookMark compares                                  }
  835. {============================================================================}
  836.  
  837. type
  838.   PCMPBkMkRslt = ^CMPBkMkRslt;
  839.   CMPBkMkRslt = WordEnum;
  840. const
  841.     CMPLess           = -1;          { Bkm1 < Bkm2 }
  842.     CMPEql            = 0;           { BookMarks are exactly the same }
  843.     CMPGtr            = 1;           { Bkm1 > Bkm2 }
  844.     CMPKeyEql         = 2;           { Only Bkm1.key_val = Bkm2.key_val }
  845.  
  846. {============================================================================}
  847. {                             Key searches                                   }
  848. {============================================================================}
  849.  
  850. type
  851. {$IFDEF VER80}
  852.   DBISearchCond = (                  { Search condition for keys }
  853.     keySEARCHEQ,                     { = }
  854.     keySEARCHGT,                     { > }
  855.     keySEARCHGEQ                     { >= }
  856.   );
  857. {$ELSE}
  858.   DBISearchCond = WordEnum;
  859. const
  860.     keySEARCHEQ  = 0;                { = }
  861.     keySEARCHGT  = 1;                { > }
  862.     keySEARCHGEQ = 2;                { >= }
  863. {$ENDIF}
  864.  
  865.  
  866. {============================================================================}
  867. {                      Create/Restructure descriptor                         }
  868. {============================================================================}
  869.  
  870. type
  871.   pCROpType          = ^CROpType;
  872. {$IFDEF VER80}
  873.   CROpType = (                       { Create/Restruct Operation type }
  874.     crNOOP,
  875.     crADD,                           { Add a new element. }
  876.     crCOPY,                          { Copy an existing element. }
  877.     crMODIFY,                        { Modify an element. }
  878.     crDROP,                          { Removes an element. }
  879.     crREDO,                          { Reconstruct an element. }
  880.     crTABLE,                         { Not used }
  881.     crGROUP,                         { Not used }
  882.     crFAMILY,                        { Not used }
  883.     crDONE,                          { Used internally }
  884.     crDROPADD                        { Used internally }
  885.   );
  886. {$ELSE}
  887.   CROpType = WordEnum;               { Create/Restruct Operation type }
  888. const
  889.     crNOOP     = 0;
  890.     crADD      = 1;                  { Add a new element. }
  891.     crCOPY     = 2;                  { Copy an existing element. }
  892.     crMODIFY   = 3;                  { Modify an element. }
  893.     crDROP     = 4;                  { Removes an element. }
  894.     crREDO     = 5;                  { Reconstruct an element. }
  895.     crTABLE    = 6;                  { Not used }
  896.     crGROUP    = 7;                  { Not used }
  897.     crFAMILY   = 8;                  { Not used }
  898.     crDONE     = 9;                  { Used internally }
  899.     crDROPADD  = 10;                 { Used internally }
  900. {$ENDIF}
  901.  
  902. type
  903.   pCRTblDesc         = ^CRTblDesc;
  904.   CRTblDesc = packed record          { Create/Restruct Table descr }
  905.     szTblName       : DBITBLNAME;    { TableName incl. optional path & ext }
  906.     szTblType       : DBINAME;       { Driver type (optional) }
  907.     szErrTblName    : DBIPATH;       { Error Table name (optional) }
  908.     szUserName      : DBINAME;       { User name (if applicable) }
  909.     szPassword      : DBINAME;       { Password (optional) }
  910.     bProtected      : WordBool;      { Master password supplied in szPassword }
  911.     bPack           : WordBool;      { Pack table (restructure only) }
  912.     iFldCount       : Word;          { Number of field defs supplied }
  913.     pecrFldOp       : pCROpType;     { Array of field ops }
  914.     pfldDesc        : pFLDDesc;      { Array of field descriptors }
  915.     iIdxCount       : Word;          { Number of index defs supplied }
  916.     pecrIdxOp       : pCROpType;     { Array of index ops }
  917.     pidxDesc        : PIDXDesc;      { Array of index descriptors }
  918.     iSecRecCount    : Word;          { Number of security defs supplied }
  919.     pecrSecOp       : pCROpType;     { Array of security ops }
  920.     psecDesc        : pSECDesc;      { Array of security descriptors }
  921.     iValChkCount    : Word;          { Number of val checks }
  922.     pecrValChkOp    : pCROpType;     { Array of val check ops }
  923.     pvchkDesc       : pVCHKDesc;     { Array of val check descs }
  924.     iRintCount      : Word;          { Number of ref int specs }
  925.     pecrRintOp      : pCROpType;     { Array of ref int ops }
  926.     printDesc       : pRINTDesc;     { Array of ref int specs }
  927.     iOptParams      : Word;          { Number of optional parameters }
  928.     pfldOptParams   : pFLDDesc;      { Array of field descriptors }
  929.     pOptData        : Pointer;       { Optional parameters }
  930.   end;
  931.  
  932. {============================================================================}
  933. {                      Batch                                                 }
  934. {============================================================================}
  935.  
  936. type
  937.   pBATTblDesc        = ^BATTblDesc;
  938.   BATTblDesc = packed record         { Batch Table definition struct }
  939.     hDb             : hDBIDb;        { Database }
  940.     szTblName       : DBIPATH;       { Table name }
  941.     szTblType       : DBINAME;       { Optional Driver type }
  942.     szUserName      : DBINAME;       { Optional User name }
  943.     szPassword      : DBINAME;       { Optional Pass word }
  944.   end;
  945.  
  946. {$IFDEF VER80}
  947.   eBATMode = (                       { Batch mode for DBIBatchMove }
  948.     batchAPPEND,
  949.     batchUPDATE,
  950.     batchAPPENDUPDATE,
  951.     batchSUBTRACT,
  952.     batchCOPY
  953.   );
  954. {$ELSE}
  955.   eBATMode = WordEnum;               { Batch mode for DBIBatchMove }
  956. const
  957.     batchAPPEND        = 0;
  958.     batchUPDATE        = 1;
  959.     batchAPPENDUPDATE  = 2;
  960.     batchSUBTRACT      = 3;
  961.     batchCOPY          = 4;
  962. {$ENDIF}
  963.  
  964. type
  965.   pSORTOrder         = ^SORTOrder;
  966.   SORTOrder = (                      { Sort Order }
  967.     sortASCEND,                      { ascending (default) }
  968.     sortDESCEND                      { descending }
  969.   );
  970.  
  971.   ppfSORTCompFn = ^pfSORTCompFn;
  972.   pfSORTCompFn = function (          { pntr to client compare fn }
  973. var   LdObj         : Pointer;       { Language driver, if needed }
  974. var   Value1        : Pointer;       { first value }
  975. var   Value2        : Pointer;       { second value }
  976.       iLen          : Integer        { Length, if needed }
  977.    ): Integer;
  978.  
  979.    { Returns: -1 if (Value 1 < Value 2),  }
  980.    {           0 if (Value 1 == Value 2), }
  981.    {          +1 if (Value 1 > Value 2)   }
  982.  
  983.  
  984. {============================================================================}
  985. {                       Types/Structs for Capabilities                       }
  986. {============================================================================}
  987.  
  988. type
  989. {$IFDEF VER80}
  990.   DRVCat = (                         { Driver Category }
  991.     drvFILLER,                       { Filler to make next start at 1 }
  992.     drvFILE,                         { File based (Paradox, xBASE) }
  993.     drvOTHERSERVER,                  { Other kind of server (IMS ?) }
  994.     drvSQLBASEDSERVER                { SQL Based Server }
  995.   );
  996.  
  997.   OPType = (                         { Config info & Optional Parameters }
  998.     opFILLER0,                       { Filler to make first one 3 }
  999.     opFILLER1,                       { Filler to make first one 3 }
  1000.     opFILLER2,                       { Filler to make first one 3 }
  1001.     opDBCREATE,
  1002.     opDBOPEN,
  1003.     opTBLCREATE,
  1004.     opTBLOPEN
  1005.   );
  1006. {$ELSE}
  1007.   DRVCat = WordEnum;                 { Driver Category }
  1008. const
  1009.     drvFILE           = 1;           { File based (Paradox  xBASE) }
  1010.     drvOTHERSERVER    = 2;           { Other kind of server (IMS ?) }
  1011.     drvSQLBASEDSERVER = 3;           { SQL Based Server }
  1012.  
  1013. type
  1014.   OPType = WordEnum;                 { Config info & Optional Parameters }
  1015. const
  1016.     opDBCREATE        = 3;
  1017.     opDBOPEN          = 4;
  1018.     opTBLCREATE       = 5;
  1019.     opTBLOPEN         = 6;
  1020. {$ENDIF}
  1021.  
  1022. type
  1023.   pDRVType = ^DRVType;
  1024.   DRVType = packed record            { Driver Description/Capabilities }
  1025.     szType          : DBINAME;       { Symbolic name to identify }
  1026.     szText          : DBINAME;       { Descriptive text }
  1027.     edrvCat         : DRVCat;        { Driver category }
  1028.     bTrueDb         : WordBool;      { Supports True Db concept }
  1029.     szDbType        : DBINAME;       { Db Type to be used }
  1030.     bMultiUser      : WordBool;      { Supports Multi-user access }
  1031.     bReadWrite      : WordBool;      { Read Write or Read-only }
  1032.     bTrans          : WordBool;      { Supports Transactions }
  1033.     bPassThruSQL    : WordBool;      { Supports Pass-thru SQL }
  1034.     bLogIn          : WordBool;      { Requires explicit login }
  1035.     bCreateDb       : WordBool;      { Can reate a Database }
  1036.     bDeleteDb       : WordBool;      { Can drop database }
  1037.     bCreateTable    : WordBool;      { Can create a Table }
  1038.     bDeleteTable    : WordBool;      { Can delete a Table }
  1039.     bMultiplePWs    : WordBool;      { Multiple passwords }
  1040.     iDriverVersion  : Word;          { Driver version 1..n }
  1041.     bSQLRowid       : WordBool;      { Supports SQL rowid }
  1042.     iUnUsed         : packed array [0..14] of Word;
  1043.   end;
  1044.  
  1045.  
  1046.   pTBLType = ^TBLType;
  1047.   TBLType = packed record            { Table Capabilities }
  1048.     iId             : Word;          { Id of Table Type }
  1049.     szName          : DBINAME;       { Symbolic name; eg "dBASE" }
  1050.     szText          : DBINAME;       { Descriptive text }
  1051.     szFormat        : DBINAME;       { Format; eg "HEAP" }
  1052.     bReadWrite      : WordBool;      { User can Read/Write }
  1053.     bCreate         : WordBool;      { Can create new tables }
  1054.     bRestructure    : WordBool;      { Can restructure this table }
  1055.     bValChecks      : WordBool;      { Val Checks can be specified }
  1056.     bSecurity       : WordBool;      { Can be protected }
  1057.     bRefIntegrity   : WordBool;      { Can participate in ref integrity }
  1058.     bPrimaryKey     : WordBool;      { Supports primary key concept }
  1059.     bIndexing       : WordBool;      { Can have other indexes }
  1060.     iFldTypes       : Word;          { Number of Phy Field types supported }
  1061.     iMaxRecSize     : Word;          { Max record size }
  1062.     iMaxFldsInTable : Word;          { Max fields in a table }
  1063.     iMaxFldNameLen  : Word;          { Maximum field name length }
  1064.     iTblLevel       : Word;          { Driver dependent table level (version) }
  1065.     iUnUsed         : packed array [0..15] of Word;
  1066.   end;
  1067.  
  1068.  
  1069.   pIDXType = ^IDXType;
  1070.   IDXType = packed record
  1071.     iId             : Word;          { Id of index type }
  1072.     szName          : DBINAME;       { Symbolic name }
  1073.     szText          : DBINAME;       { Descriptive text }
  1074.     szFormat        : DBINAME;       { Optional format(BTREE, HASH etc) }
  1075.     bComposite      : WordBool;      { If composite keys are supported }
  1076.     bPrimary        : WordBool;      { True, if primary index }
  1077.     bUnique         : WordBool;      { True, No duplicates supported }
  1078.     bKeyDescending  : WordBool;      { If whole key can be descending }
  1079.     bFldDescending  : WordBool;      { Field level descending }
  1080.     bMaintained     : WordBool;      { Supports maintained option }
  1081.     bSubset         : WordBool;      { If Subset expression supported }
  1082.     bKeyExpr        : WordBool;      { If Key can be expression }
  1083.     bCaseInsensitive : WordBool;     { If Keyinsensitive indexes supported }
  1084.     iUnUsed         : packed array [0..15] of Word;
  1085.   end;
  1086.  
  1087.   pFLDType = ^FLDType;
  1088.   FLDType = packed record
  1089.     iId             : Word;          { Id of Field Type }
  1090.     szName          : DBINAME;       { Symbolic name; eg "ALPHA" }
  1091.     szText          : DBINAME;       { Descriptive text }
  1092.     iPhyType        : Word;          { Physical/Native type }
  1093.     iXltType        : Word;          { Default xlated type }
  1094.     iXltSubType     : Word;          { Default xlated sub type }
  1095.     iMaxUnits1      : Word;          { Max units allowed (1) }
  1096.     iMaxUnits2      : Word;          { Max units allowed (2) }
  1097.     iPhySize        : Word;          { Physical size in bytes (per unit) }
  1098.     bRequired       : WordBool;      { Supports 'required' option }
  1099.     bDefaultVal     : WordBool;      { Supports user specified 'default' }
  1100.     bMinVal         : WordBool;      { Supports MIN Val constraint }
  1101.     bMaxVal         : WordBool;      { Supports MAX Val constraint }
  1102.     bRefIntegrity   : WordBool;      { Can participate in ref integrity }
  1103.     bOtherChecks    : WordBool;      { Supports other kinds of checks }
  1104.     bKeyed          : WordBool;      { The field type can be keyed }
  1105.     bMultiplePerTable : WordBool;    { Table can have more than 1 of this type }
  1106.     iMinUnits1      : Word;          { Min units required (1) }
  1107.     iMinUnits2      : Word;          { Min units required (2) }
  1108.     bCreateable     : WordBool;      { Type can be created }
  1109.     iUnUsed         : packed array [0..15] of Word;
  1110.   end;
  1111.  
  1112. {$IFDEF VER80}
  1113.   PROPValid = (                      { PROP Validity }
  1114.     epropINVALID,                    { Property is INVALID (not supported) }
  1115.     epropCANGET,                     { You can GET value of the property }
  1116.     epropCANSET                      { You can GET and SET value of the property }
  1117.   );
  1118. {$ELSE}
  1119.   PROPValid = WordEnum;              { PROP Validity }
  1120. const
  1121.     epropINVALID = 0;                { Property is INVALID (not supported) }
  1122.     epropCANGET  = 1;                { You can GET value of the property }
  1123.     epropCANSET  = 2;                { You can GET and SET value of the property }
  1124. {$ENDIF}
  1125.  
  1126. {============================================================================}
  1127. {                                Call Backs                                  }
  1128. {============================================================================}
  1129.  
  1130. type
  1131.   pCBType            = ^CBType;
  1132.  
  1133. {$IFDEF VER80}
  1134.   CBType = (                         { Call back type }
  1135.     cbGENERAL,                       { General purpose }
  1136.     cbRESERVED1,
  1137.     cbRESERVED2,
  1138.     cbINPUTREQ,                      { Input requested }
  1139.     cbRESERVED4,
  1140.     cbRESERVED5,
  1141.     cbBATCHRESULT,                   { Batch processing rslts }
  1142.     cbRESERVED7,
  1143.     cbRESTRUCTURE,                   { Restructure }
  1144.     cbRESERVED9,
  1145.     cbRESERVED10,
  1146.     cbRESERVED11,
  1147.     cbRESERVED12,
  1148.     cbRESERVED13,
  1149.     cbRESERVED14,
  1150.     cbRESERVED15,
  1151.     cbRESERVED16,
  1152.     cbRESERVED17,
  1153.     cbTABLECHANGED,                  { Table changed notification }
  1154.     cbRESERVED19,
  1155.     cbRESERVED20,
  1156.     cbRESERVED21,
  1157.     cbRESERVED22,
  1158.     cbGENPROGRESS,                   { Generic Progress report. }
  1159.     cbDBASELOGIN,                    { dBASE Login }
  1160.     cbNBROFCBS                       { Number of cbs }
  1161.   );
  1162.  
  1163.   pCBRType           = ^CBRType;
  1164.   CBRType = (                        { Call-back return type }
  1165.     cbrUSEDEF,                       { Take default action }
  1166.     cbrCONTINUE,                     { Continue }
  1167.     cbrABORT,                        { Abort the operation }
  1168.     cbrCHKINPUT,                     { Input given }
  1169.     cbrYES,                          { Take requested action }
  1170.     cbrNO,                           { Do not take requested action }
  1171.     cbrPARTIALASSIST                 { Assist in completing the job }
  1172.   );
  1173. {$ELSE}
  1174.   CBType             = WordEnum;     { Call back type }
  1175. const
  1176.     cbGENREAL       = 0;             { General purpose }
  1177.     cbRESERVED1     = 1;
  1178.     cbRESERVED2     = 2;
  1179.     cbINPUTREQ      = 3;             { Input requested }
  1180.     cbRESERVED4     = 4;
  1181.     cbRESERVED5     = 5;
  1182.     cbBATCHRESULT   = 6;             { Batch processing rslts }
  1183.     cbRESERVED7     = 7;
  1184.     cbRESTRUCTURE   = 8;             { Restructure }
  1185.     cbRESERVED9     = 9;
  1186.     cbRESERVED10    = 10;
  1187.     cbRESERVED11    = 11;
  1188.     cbRESERVED12    = 12;
  1189.     cbRESERVED13    = 13;
  1190.     cbRESERVED14    = 14;
  1191.     cbRESERVED15    = 15;
  1192.     cbRESERVED16    = 16;
  1193.     cbRESERVED17    = 17;
  1194.     cbTABLECHANGED  = 18;            { Table changed notification }
  1195.     cbRESERVED19    = 19;
  1196.     cbRESERVED20    = 20;
  1197.     cbRESERVED21    = 21;
  1198.     cbRESERVED22    = 22;
  1199.     cbGENPROGRESS   = 23;            { Generic Progress report. }
  1200.     cbDBASELOGIN    = 24;             { dBASE Login }
  1201.     cbNBROFCBS      = 25;            { Number of cbs }
  1202.  
  1203. type
  1204.   pCBRType           = ^CBRType;
  1205.   CBRType            = WordEnum;     { Call-back return type }
  1206. const
  1207.     cbrUSEDEF       = 0;             { Take default action }
  1208.     cbrCONTINUE     = 1;             { Continue }
  1209.     cbrABORT        = 2;             { Abort the operation }
  1210.     cbrCHKINPUT     = 3;             { Input given }
  1211.     cbrYES          = 4;             { Take requested action }
  1212.     cbrNO           = 5;             { Do not take requested action }
  1213.     cbrPARTIALASSIST= 6;             { Assist in completing the job }
  1214. {$ENDIF}
  1215.  
  1216. type
  1217.   ppfDBICallBack = ^pfDBICallBack;
  1218.   pfDBICallBack  = function (        { Call-back funtion pntr type }
  1219.       ecbType       : CBType;        { Callback type }
  1220.       iClientData   : Longint;       { Client callback data }
  1221. var   CbInfo        : Pointer        { Call back info/Client Input }
  1222.    ): CBRType;
  1223.  
  1224. { Progress callback structure }
  1225.  
  1226.   pCBPROGRESSDesc    = ^CBPROGRESSDesc;
  1227.   CBPROGRESSDesc = packed record
  1228.     iPercentDone    : Integer;       { Percentage done. }
  1229.     szMsg           : DBIMSG;        { Message to display }
  1230.   end;
  1231.  
  1232. {$IFDEF VER80}
  1233.   RESTErrObjType = (                 { type of restructure object (restructure callback) }
  1234.     restrNONE,
  1235.     restrNEWFLD,
  1236.     restrOLDFLD,
  1237.     restrNEWINDEX,
  1238.     restrOLDINDEX,
  1239.     restrNEWVCHK,
  1240.     restrOLDVCHK,
  1241.     restrNEWRINT,
  1242.     restrOLDRINT,
  1243.     restrNEWSEC,
  1244.     restrOLDSEC,
  1245.     restrNEWTABLE
  1246.   );
  1247. {$ELSE}
  1248.   RESTErrObjType = WordEnum;         { type of restructure object (restructure callback) }
  1249. const
  1250.     restrNONE        = 0;
  1251.     restrNEWFLD      = 1;
  1252.     restrOLDFLD      = 2;
  1253.     restrNEWINDEX    = 3;
  1254.     restrOLDINDEX    = 4;
  1255.     restrNEWVCHK     = 5;
  1256.     restrOLDVCHK     = 6;
  1257.     restrNEWRINT     = 7;
  1258.     restrOLDRINT     = 8;
  1259.     restrNEWSEC      = 9;
  1260.     restrOLDSEC      = 10;
  1261.     restrNEWTABLE    = 11;
  1262. {$ENDIF}
  1263.  
  1264. type
  1265.   TuObjDesc = packed record
  1266.     case Integer of
  1267.       1: (fldDesc:  FLDDesc);
  1268.       2: (idxDesc:  IDXDesc);
  1269.       3: (vchkDesc: VCHKDesc);
  1270.       4: (rintDesc: RINTDesc);
  1271.       5: (secDesc:  SECDesc);
  1272.   end;
  1273.  
  1274.   RESTCbDesc = packed record         { restructure callback info }
  1275.     iErrCode        : DBIResult;
  1276.     iTblNum         : Word;
  1277.     iObjNum         : Word;
  1278.     eRestrObjType   : RESTErrObjType;
  1279.     uObjDesc        : TuObjDesc;
  1280.   end;
  1281.  
  1282.   CBEntry = packed record            { Entries for input requested callback }
  1283.     szKeyWord       : DBINAME;
  1284.     szHelp          : DBIMSG;
  1285.   end;
  1286.     
  1287.  
  1288. {$IFDEF VER80}
  1289.   CBInputId = (                      { Id for input requested callback }
  1290.     cbiFILLER,                       { Filler to make next start at 1 }
  1291.     cbiMDXMISSING,                   { MDX file missing request }
  1292.     cbiPDXLOOKUP,                    { Lookup table missing }
  1293.     cbiPDXBLOB,                      { Blob file missing }
  1294.     cbiDBTMISSING                    { DBT file missing request }
  1295.   );
  1296. {$ELSE}
  1297.   CBInputId = WordEnum;              { Id for input requested callback }
  1298. const
  1299.     cbiMDXMISSING    = 1;            { MDX file missing request }
  1300.     cbiPDXLOOKUP     = 2;            { Lookup table missing }
  1301.     cbiPDXBLOB       = 3;            { Blob file missing }
  1302.     cbiDBTMISSING    = 4;            { DBT file missing request }
  1303. {$ENDIF}
  1304.  
  1305. const
  1306.     MAXCBENTRIES     = 4;
  1307.  
  1308. type
  1309.   CBInputDesc = packed record        { Input requested callback structure }
  1310.     eCbInputId    : CBInputId;       { Id for this input request }
  1311.     iCount        : Integer;         { Number of entries }
  1312.     iSelection    : Integer;         { Selection 1..n  (In/Out) }
  1313.     bSave         : WordBool;        { Save this option  (In/Out) }
  1314.     szMsg         : DBIMSG;          { Message to display }
  1315.     acbEntry      : packed array [0..MAXCBENTRIES-1] of CBEntry; { Entries }
  1316.   end;
  1317.  
  1318.   CBLoginDesc = packed record        { dBASE login callback structure }
  1319.     szUserName      : DBINAME;       { Login name of user }
  1320.     szGroupName     : DBINAME;       { Group to log in to }
  1321.     szUserPassword  : DBINAME;       { User password }
  1322.   end;
  1323.  
  1324.   pCBLoginDesc = ^CBLoginDesc;
  1325.  
  1326. { cbSERVERCALL info }
  1327.  
  1328. {$IFDEF VER80}
  1329.   CBSCType = (                       { Server call type }
  1330.     cbscRETURN,                      { Return from a call }
  1331.     cbscSQL                          { SQL server call }
  1332.   );
  1333. {$ELSE}
  1334.   CBSCType = WordEnum;               { Server call type }
  1335. const
  1336.     cbscRETURN       = 0;            { Return from a call }
  1337.     cbscSQL          = 1;            { SQL server call }
  1338. {$ENDIF}
  1339.  
  1340. const
  1341.   cbSERVERCALL       = cbRESERVED21;
  1342.  
  1343. {============================================================================}
  1344. {                         Basic Query Types                                  }
  1345. {============================================================================}
  1346.  
  1347. type
  1348. {$IFDEF VER80}
  1349.   DBIQryLang = (
  1350.     qrylangUNKNOWN,                  { UNKNOWN (Error) }
  1351.     qrylangQBE,                      { QBE }
  1352.     qrylangSQL                       { SQL }
  1353.   );
  1354. {$ELSE}
  1355.   DBIQryLang = WordEnum;
  1356. const
  1357.     qrylangUNKNOWN = 0;              { UNKNOWN (Error) }
  1358.     qrylangQBE     = 1;              { QBE }
  1359.     qrylangSQL     = 2;              { SQL }
  1360. {$ENDIF}
  1361.  
  1362. {============================================================================}
  1363. {                         Statement parameter information                    }
  1364. {============================================================================}
  1365.  
  1366. type
  1367.   eINDValues = WordEnum;
  1368. const
  1369.     indTRUNC     = -2;                { Value has been truncated }
  1370.     indNULL      = -1;                { Value is NULL }
  1371.     indVALUE     = 1;
  1372.  
  1373. const
  1374.   INDLEN             = sizeof(Word);
  1375.  
  1376. {$IFDEF VER80}
  1377. type
  1378.   STMTParamType = (
  1379.     paramUNKNOWN,                    { UNKNOWN (Error) }
  1380.     paramIN,                         { Input parameter }
  1381.     paramOUT,                        { Output parameter }
  1382.     paramINOUT,                      { Input/Output parameter }
  1383.     paramRET                         { Procedure (or function) return }
  1384.   );
  1385.  
  1386.   STMTParamFormat = (
  1387.     paramfmtUNKNOWN,                 { UNKNOWN (Error) }
  1388.     paramfmtNUMBER,                  { Numbered parameter markers of the form ? or :n }
  1389.     paramfmtNAME                     { Named parameters markers of the form :name }
  1390.   );
  1391. {$ELSE}
  1392. type
  1393.   STMTParamType = WordEnum;
  1394. const
  1395.     paramUNKNOWN = 0;                { UNKNOWN (Error) }
  1396.     paramIN      = 1;                { Input parameter }
  1397.     paramOUT     = 2;                { Output parameter }
  1398.     paramINOUT   = 3;                { Input/Output parameter }
  1399.     paramRET     = 4;                { Procedure (or function) return }
  1400.  
  1401. type
  1402.   STMTParamFormat = WordEnum;
  1403. const
  1404.     paramfmtUNKNOWN = 0;             { UNKNOWN (Error) }
  1405.     paramfmtNUMBER  = 1;             { Numbered parameter markers of the form ? or :n }
  1406.     paramfmtNAME    = 2;             { Named parameters markers of the form :name }
  1407. {$ENDIF}
  1408.  
  1409. {============================================================================}
  1410. {                         Properties For DbiQPrepareExt                      }
  1411. {============================================================================}
  1412.  
  1413. const
  1414.   qprepNONE          = 0;            { like DbiQPrepare }
  1415.   qprepFORUPDATE     = $1;           { do extra work, anticipating UPDATE WHERE CURRENT }
  1416.  
  1417.  
  1418. {============================================================================}
  1419. {                      Date, Time, Number Formats                            }
  1420. {============================================================================}
  1421.  
  1422. type
  1423.   pFMTNumber = ^FMTNumber;
  1424.   FMTNumber = packed record          { Date Format }
  1425.     cDecimalSeparator : Char;        { Default "." }
  1426.     cThousandSeparator : Char;       { Default "," }
  1427.     iDecimalDigits  : Byte;          { Default 2 }
  1428.     bLeadingZero    : Boolean;       { Default TRUE. }
  1429.   end;
  1430.  
  1431.   pFMTDate = ^FMTDate;
  1432.   FMTDate = packed record
  1433.     szDateSeparator : packed array [0..3] of Char; { Default "/" }
  1434.     iDateMode       : Byte;      { 0 = MDY (Def), 1 = DMY, 2 = YMD }
  1435.     bFourDigitYear  : Boolean;   { Write Year as 4 digits (FALSE) }
  1436.     bYearBiased     : Boolean;   { On input add 1900 to year (TRUE) }
  1437.     bMonthLeadingZero : Boolean; { Month with Leading Zero (TRUE) }
  1438.     bDayLeadingZero : Boolean;   { Day with Leading Zero (TRUE) }
  1439.   end;
  1440.  
  1441.   pFMTTime = ^FMTTime;
  1442.   FMTTime = packed record
  1443.     cTimeSeparator  : Char;          { Default ":" }
  1444.     bTwelveHour     : Boolean;       { Represent as 12 Hour time (FALSE) }
  1445.     szAmString      : packed array [0..5] of Char; { Default Null (Only for 12 Hr) }
  1446.     szPmString      : packed array [0..5] of Char; { Default Null (Only for 12 Hr) }
  1447.     bSeconds        : Boolean;       { Show Seconds (TRUE) }
  1448.     bMilSeconds     : Boolean;       { Show Milli Seconds (FALSE) }
  1449.   end;
  1450.  
  1451.   pFMTBcd            = ^FMTBcd;
  1452.   FMTBcd = packed record
  1453.     iPrecision      : Byte;          { 1..64 considered valid }
  1454.     iSignSpecialPlaces : Byte;       { sign:1, special:1, places:6 }
  1455.     iFraction       : packed array [0..31] of Byte; { bcd nibbles, 00..99 per byte, high nibble 1st }
  1456.   end;
  1457.  
  1458.  
  1459. {============================================================================}
  1460. {                              Error Info                                    }
  1461. {============================================================================}
  1462.  
  1463. type
  1464.   pDBIErrInfo        = ^DBIErrInfo;
  1465.   DBIErrInfo = packed record         { Error info }
  1466.     iError          : DBIResult;     { Last error code returned }
  1467.     szErrCode       : DBIMSG;        { Error Code }
  1468.     szContext       : packed array[1..4] of DBIMSG; { Context info }
  1469.   end;
  1470.  
  1471. { Error contexts (To be used with DbiGetErrorContext) }
  1472.  
  1473. const
  1474.   ecTOKEN            = 1;            { Token (For QBE) }
  1475.   ecTABLENAME        = 3;            { Table name }
  1476.   ecFIELDNAME        = 4;            { Field Name }
  1477.   ecIMAGEROW         = 5;            { Image Row (For QBE) }
  1478.   ecUSERNAME         = 6;            { eg, In lock conflicts, user involved }
  1479.   ecFILENAME         = 7;            { File Name }
  1480.   ecINDEXNAME        = 8;            { Index Name }
  1481.   ecDIRNAME          = 9;            { Directory Name }
  1482.   ecKEYNAME          = 10;           { Key Name }
  1483.   ecALIAS            = 11;           { Alias }
  1484.   ecDRIVENAME        = 12;           { Drive name ('c:') }
  1485.   ecNATIVECODE       = 13;           { Native error code }
  1486.   ecNATIVEMSG        = 14;           { Native error message }
  1487.   ecLINENUMBER       = 15;           { Line Number }
  1488.   ecCAPABILITY       = 16;           { Capability }
  1489.   ecINTERNALLIMIT    = 17;           { Internal limit }
  1490.  
  1491. {============================================================================}
  1492. {                  Schema info structures                                    }
  1493. {============================================================================}
  1494. {                    Database descriptor                                     }
  1495. {============================================================================}
  1496.  
  1497.  
  1498. { DbiOpenDbList }
  1499. type
  1500.   pDBDesc = ^DBDesc;
  1501.   DBDesc = packed record             { A given Database Description }
  1502.     szName          : DBINAME;       { Logical name (Or alias) }
  1503.     szText          : DBINAME;       { Descriptive text }
  1504.     szPhyName       : DBIPATH;       { Physical name/path }
  1505.     szDbType        : DBINAME;       { Database type }
  1506.   end;
  1507.  
  1508.  
  1509. {============================================================================}
  1510. {                    User info descriptor                                    }
  1511. {============================================================================}
  1512.  
  1513.  
  1514. { DbiOpenUserList }
  1515. type
  1516.   pUSERDesc = ^USERDesc;
  1517.   USERDesc = packed record           { User description }
  1518.     szUserName      : DBIUSERNAME;
  1519.     iNetSession     : Word;          { Net level session number }
  1520.     iProductClass   : Word;          { Product class of user }
  1521.     szSerialNum     : packed array [0..21] of Char; { Serial number }
  1522.   end;
  1523.  
  1524. {============================================================================}
  1525. {                    Table descriptor                                        }
  1526. {============================================================================}
  1527.  
  1528.  
  1529. { DbiOpenTableList }
  1530. type
  1531.   pTBLBaseDesc = ^TBLBaseDesc;
  1532.   TBLBaseDesc = packed record        { Table description (Base) }
  1533.     szName          : DBITBLNAME;    { Table name(No extension or Dir) }
  1534.     szFileName      : DBITBLNAME;    { File name }
  1535.     szExt           : DBIEXT;        { File extension }
  1536.     szType          : DBINAME;       { Driver type }
  1537.     dtDate          : Date;          { Date on the table }
  1538.     tmTime          : Time;          { Time on the table }
  1539.     iSize           : Longint;       { Size in bytes }
  1540.     bView           : WordBool;      { If this a view }
  1541.   end;
  1542.  
  1543.   pTBLExtDesc = ^TBLExtDesc;
  1544.   TBLExtDesc = packed record         { Table description (Extended part) }
  1545.     szStruct        : DBINAME;       { Physical structure }
  1546.     iRestrVersion   : Word;          { Version # }
  1547.     iRecSize        : Word;          { Physical record size }
  1548.     iFields         : Word;          { Number of fields }
  1549.     iIndexes        : Word;          { Number Indexes }
  1550.     iValChecks      : Word;          { Number of field validity checks }
  1551.     iRintChecks     : Word;          { Number of ref. integrity checks }
  1552.     iRecords        : Longint;       { Number of records in table }
  1553.     bProtected      : WordBool;      { If the table is prot }
  1554.     bValidInfo      : WordBool;      { Info available for this table }
  1555.   end;
  1556.  
  1557.   pTBLFullDesc = ^TBLFullDesc;
  1558.   TBLFullDesc = packed record        { Table description (Base + Ext) }
  1559.     tblBase         : TBLBaseDesc;   { Base      description }
  1560.     tblExt          : TBLExtDesc;    { Extended  description }
  1561.   end;
  1562.  
  1563. {============================================================================}
  1564. {                    File descriptor                                         }
  1565. {============================================================================}
  1566.  
  1567.  
  1568. { DbiOpenFileList }
  1569. type
  1570.   pFILEDesc = ^FILEDesc;
  1571.   FILEDesc = packed record           { File description }
  1572.     szFileName      : DBIPATH;       { File name (No Dir or ext) }
  1573.     szExt           : DBIEXT;        { Extension }
  1574.     bDir            : WordBool;      { True, if directory }
  1575.     iSize           : Longint;       { File size in bytes }
  1576.     dtDate          : Date;          { Date on the file }
  1577.     tmTime          : Time;          { Time on the file }
  1578.   end;
  1579.  
  1580. {======================================================================}
  1581. {            Stored Procedure and Stored Procedure Param descriptor    }
  1582. {======================================================================}
  1583.  
  1584. type
  1585.   pSPDesc = ^SPDesc;
  1586.   SPDesc = packed record
  1587.     szName          : DBISPNAME;
  1588.     dtDate          : Date;
  1589.     tmTime          : Time;
  1590.   end;
  1591.  
  1592.   pSPParamDesc = ^SPParamDesc;
  1593.   SPParamDesc = packed record
  1594.     uParamNum       : Word;
  1595.     szName          : DBINAME;
  1596.     eParamType      : STMTParamType;
  1597.     uFldType        : Word;
  1598.     uSubType        : Word;
  1599.     iUnits1         : Integer;
  1600.     iUnits2         : Integer;
  1601.     uOffset         : Word;
  1602.     uLen            : Word;
  1603.     uNullOffset     : Word;
  1604.   end;
  1605.  
  1606. {============================================================================}
  1607. {                   Configuration Info Descriptor                            }
  1608. {============================================================================}
  1609.  
  1610. {$IFDEF VER80}
  1611.   CFGMode = (
  1612.     cfgPersistent,                   { Persistent only }
  1613.     cfgSession,                      { Session relative only }
  1614.     cfgAll                           { All (union) }
  1615.   );
  1616. {$ELSE}
  1617.   CFGMode = WordEnum;
  1618. const
  1619.     cfgPersistent = 0;               { Persistent only }
  1620.     cfgSession    = 1;               { Session relative only }
  1621.     cfgAll        = 2;               { All (union) }
  1622. {$ENDIF}
  1623.  
  1624.  
  1625. { DbiOpenCfgInfoList }
  1626. type
  1627.   pCFGDesc = ^CFGDesc;
  1628.   CFGDesc = packed record            { Config description }
  1629.     szNodeName      : DBINAME;       { Node name }
  1630.     szDescription   : packed array [0..DBIMAXSCFLDLEN-1] of Char; { Node description }
  1631.     iDataType       : Word;          { Value type }
  1632.     szValue         : packed array [0..DBIMAXSCFLDLEN-1] of Char; { Value }
  1633.     bHasSubnodes    : WordBool;      { True, if not leaf node }
  1634.   end;
  1635.  
  1636.  
  1637. {============================================================================}
  1638. {                    Family descriptor                                       }
  1639. {============================================================================}
  1640.  
  1641. type
  1642.   pFMLType           = ^FMLType;
  1643. {$IFDEF VER80}
  1644.   FMLType = (                        { Family member types }
  1645.     fmlUNKNOWN,
  1646.     fmlTABLE,
  1647.     fmlINDEX,
  1648.     fmlFORM,
  1649.     fmlREPORT,
  1650.     fmlVALCHECK,
  1651.     fmlSECINDEX,
  1652.     fmlSECINDEX2,
  1653.     fmlBLOBFILE
  1654.   );
  1655. {$ELSE}
  1656.   FMLType = WordBool;                { Family member types }
  1657. const
  1658.     fmlUNKNOWN    = 0;
  1659.     fmlTABLE      = 1;
  1660.     fmlINDEX      = 2;
  1661.     fmlFORM       = 3;
  1662.     fmlREPORT     = 4;
  1663.     fmlVALCHECK   = 5;
  1664.     fmlSECINDEX   = 6;
  1665.     fmlSECINDEX2  = 7;
  1666.     fmlBLOBFILE   = 8;
  1667. {$ENDIF}
  1668.  
  1669. { DbiOpenFamilyList }
  1670. type
  1671.   pFMLDesc = ^FMLDesc;
  1672.   FMLDesc = packed record            { Family record structure }
  1673.     szName          : DBINAME;       { Member name (documentary) }
  1674.     iId             : Word;          { Id (if applicable) }
  1675.     eType           : FMLType;       { Member type }
  1676.     szFileName      : DBIPATH;       { File name of member }
  1677.   end;
  1678.  
  1679.  
  1680. {============================================================================}
  1681. {                    Language driver descriptor                              }
  1682. {============================================================================}
  1683.  
  1684.  
  1685. const
  1686.   DBIOEM_CP          = 1;            { (dos) }
  1687.   DBIANSI_CP         = 2;            { (win) }
  1688.   DBIOS2_CP          = 3;
  1689. (* UNIX etc. *)
  1690.   DBISUNOS_CP        = 4;
  1691.   DBIVMS_CP          = 5;
  1692.   DBIHPUX_CP         = 6;
  1693.   DBIULTRIX_CP       = 7;
  1694.   DBIAIX_CP          = 8;
  1695.   DBIAUX_CP          = 9;
  1696.   DBIXENIX_CP        = 10;
  1697.   DBIMAC_CP          = 11;
  1698.   DBINEXT_CP         = 12;
  1699.  
  1700. { DbiOpenLdList }
  1701. type
  1702.   pLDDesc = ^LDDesc;
  1703.   LDDesc = packed record             { Lang Driver description }
  1704.     szName          : DBINAME;       { Driver symbolic name }
  1705.     szDesc          : DBINAME;       { Description }
  1706.     iCodePage       : Word;
  1707.     PrimaryCpPlatform : Word;
  1708.     AlternateCpPlatform : Word;
  1709.   end;
  1710.  
  1711. {============================================================================}
  1712. {                    Lock descriptor                                         }
  1713. {============================================================================}
  1714.  
  1715. { Lock types in LOCKDesc: }
  1716.  
  1717. const
  1718.   lckRECLOCK         = 0;            { Normal Record lock (Write) }
  1719.   lckRRECLOCK        = 1;            { Special Pdox Record lock (Read) }
  1720.   lckGROUPLOCK       = 2;            { Pdox Group lock }
  1721.   lckIMGAREA         = 3;            { Pdox Image area }
  1722.   lckTABLEREG        = 4;            { Table registration/Open (No lock) }
  1723.   lckTABLEREAD       = 5;            { Table Read lock }
  1724.   lckTABLEWRITE      = 6;            { Table Write lock }
  1725.   lckTABLEEXCL       = 7;            { Table Exclusive lock }
  1726.   lckUNKNOWN         = 9;            { Unknown lock }
  1727.  
  1728. { DbiOpenLockList }
  1729. type
  1730.   pLOCKDesc = ^LOCKDesc;
  1731.   LOCKDesc = packed record           { Lock Description }
  1732.     iType           : Word;          { Lock type (0 for rec lock) }
  1733.     szUserName      : DBIUSERNAME;   { Lock owner }
  1734.     iNetSession     : Word;          { Net level Session number }
  1735.     iSession        : Word;          { Idapi session#, if our lock }
  1736.     iRecNum         : Longint;       { If a record lock }
  1737.     iInfo           : Word;          { Info for table locks }
  1738.   end;
  1739.  
  1740. {============================================================================}
  1741. {                    Filter description                                      }
  1742. {============================================================================}
  1743.  
  1744. type
  1745.   pCANOp             = ^CANOp;
  1746. {$IFDEF VER80}
  1747.   CANOp = (
  1748.     canNOTDEFINED,                   {                                  (*) }
  1749.     canISBLANK,                      { CANUnary;  is operand blank.     (*) }
  1750.     canNOTBLANK,                     { CANUnary;  is operand not blank. (*) }
  1751.     canEQ,                           { CANBinary, CANCompare; equal.    (*) }
  1752.     canNE,                           { CANBinary; NOT equal.            (*) }
  1753.     canGT,                           { CANBinary; greater than.         (*) }
  1754.     canLT,                           { CANBinary; less than.            (*) }
  1755.     canGE,                           { CANBinary; greater or equal.     (*) }
  1756.     canLE,                           { CANBinary; less or equal.        (*) }
  1757.     canNOT,                          { CANUnary; NOT                    (*) }
  1758.     canAND,                          { CANBinary; AND                   (*) }
  1759.     canOR,                           { CANBinary; OR                    (*) }
  1760.     canTUPLE2,                       { CANUnary; Entire record is operand. }
  1761.     canFIELD2,                       { CANUnary; operand is field       (*) }
  1762.     canCONST2,                       { CANUnary; operand is constant    (*) }
  1763.     canMINUS,                        { CANUnary;  minus. }
  1764.     canADD,                          { CANBinary; addition. }
  1765.     canSUB,                          { CANBinary; subtraction. }
  1766.     canMUL,                          { CANBinary; multiplication. }
  1767.     canDIV,                          { CANBinary; division. }
  1768.     canMOD,                          { CANBinary; modulo division. }
  1769.     canREM,                          { CANBinary; remainder of division. }
  1770.     canSUM,                          { CANBinary, accumulate sum of. }
  1771.     canCOUNT,                        { CANBinary, accumulate count of. }
  1772.     canMIN,                          { CANBinary, find minimum of. }
  1773.     canMAX,                          { CANBinary, find maximum of. }
  1774.     canAVG,                          { CANBinary, find average of. }
  1775.     canCONT,                         { CANBinary; provides a link between two }
  1776.     canUDF2,                         { CANBinary; invokes a User defined fn }
  1777.     canCONTINUE2,                    { CANUnary; Stops evaluating records }
  1778.     canLIKE                          { CANCompare, extended binary compare       (*) }
  1779.   );
  1780.  
  1781.   NODEClass = (                      { Node Class }
  1782.     nodeNULL,                        { Null node                  (*) }
  1783.     nodeUNARY,                       { Node is a unary            (*) }
  1784.     nodeBINARY,                      { Node is a binary           (*) }
  1785.     nodeCOMPARE,                     { Node is a compare          (*) }
  1786.     nodeFIELD,                       { Node is a field            (*) }
  1787.     nodeCONST,                       { Node is a constant         (*) }
  1788.     nodeTUPLE,                       { Node is a record }
  1789.     nodeCONTINUE,                    { Node is a continue node    (*) }
  1790.     nodeUDF                          { Node is a UDF node }
  1791.   );
  1792. {$ELSE}
  1793.   CANOp = WordEnum;
  1794. const
  1795.     canNOTDEFINED  = 0;              {                                  (*) }
  1796.     canISBLANK     = 1;              { CANUnary;  is operand blank.     (*) }
  1797.     canNOTBLANK    = 2;              { CANUnary;  is operand not blank. (*) }
  1798.     canEQ          = 3;              { CANBinary  CANCompare; equal.    (*) }
  1799.     canNE          = 4;              { CANBinary; NOT equal.            (*) }
  1800.     canGT          = 5;              { CANBinary; greater than.         (*) }
  1801.     canLT          = 6;              { CANBinary; less than.            (*) }
  1802.     canGE          = 7;              { CANBinary; greater or equal.     (*) }
  1803.     canLE          = 8;              { CANBinary; less or equal.        (*) }
  1804.     canNOT         = 9;              { CANUnary; NOT                    (*) }
  1805.     canAND         = 10;             { CANBinary; AND                   (*) }
  1806.     canOR          = 11;             { CANBinary; OR                    (*) }
  1807.     canTUPLE2      = 12;             { CANUnary; Entire record is operand. }
  1808.     canFIELD2      = 13;             { CANUnary; operand is field       (*) }
  1809.     canCONST2      = 14;             { CANUnary; operand is constant    (*) }
  1810.     canMINUS       = 15;             { CANUnary;  minus. }
  1811.     canADD         = 16;             { CANBinary; addition. }
  1812.     canSUB         = 17;             { CANBinary; subtraction. }
  1813.     canMUL         = 18;             { CANBinary; multiplication. }
  1814.     canDIV         = 19;             { CANBinary; division. }
  1815.     canMOD         = 20;             { CANBinary; modulo division. }
  1816.     canREM         = 21;             { CANBinary; remainder of division. }
  1817.     canSUM         = 22;             { CANBinary  accumulate sum of. }
  1818.     canCOUNT       = 23;             { CANBinary  accumulate count of. }
  1819.     canMIN         = 24;             { CANBinary  find minimum of. }
  1820.     canMAX         = 25;             { CANBinary  find maximum of. }
  1821.     canAVG         = 26;             { CANBinary  find average of. }
  1822.     canCONT        = 27;             { CANBinary; provides a link between two }
  1823.     canUDF2        = 28;             { CANBinary; invokes a User defined fn }
  1824.     canCONTINUE2   = 29;             { CANUnary; Stops evaluating records }
  1825.     canLIKE        = 30;             { CANCompare  extended binary compare       (*) }
  1826.  
  1827. type
  1828.   NODEClass = WordEnum;              { Node Class }
  1829. const
  1830.     nodeNULL       = 0;              { Null node                  (*) }
  1831.     nodeUNARY      = 1;              { Node is a unary            (*) }
  1832.     nodeBINARY     = 2;              { Node is a binary           (*) }
  1833.     nodeCOMPARE    = 3;              { Node is a compare          (*) }
  1834.     nodeFIELD      = 4;              { Node is a field            (*) }
  1835.     nodeCONST      = 5;              { Node is a constant         (*) }
  1836.     nodeTUPLE      = 6;              { Node is a record }
  1837.     nodeCONTINUE   = 7;              { Node is a continue node    (*) }
  1838.     nodeUDF        = 8;              { Node is a UDF node }
  1839. {$ENDIF}
  1840.  
  1841. { NODE definitions including misc data structures }
  1842. {-------------------------------------------------}
  1843.  
  1844. type
  1845.   pCANHdr = ^CANHdr;
  1846.   CANHdr = packed record             { Header part common to all     (*) }
  1847.     nodeClass       : NODEClass;
  1848.     canOp           : CANOp;
  1849.   end;
  1850.  
  1851.   pCANUnary = ^CANUnary;
  1852.   CANUnary = packed record           { Unary Node                    (*) }
  1853.     nodeClass       : NODEClass;
  1854.     canOp           : CANOp;
  1855.     iOperand1       : Word;          { Byte offset of Operand node }
  1856.   end;
  1857.  
  1858.   pCANBinary = ^CANBinary;
  1859.   CANBinary = packed record          { Binary Node                   (*) }
  1860.     nodeClass       : NODEClass;
  1861.     canOp           : CANOp;
  1862.     iOperand1       : Word;          { Byte offset of Op1 }
  1863.     iOperand2       : Word;          { Byte offset of Op2 }
  1864.   end;
  1865.  
  1866.   pCANField = ^CANField;
  1867.   CANField = packed record           { Field }
  1868.     nodeClass       : NODEClass;
  1869.     canOp           : CANOp;
  1870.     iFieldNum       : Word;
  1871.     iNameOffset     : Word;          { Name offset in Literal pool }
  1872.   end;
  1873.  
  1874.   pCANConst = ^CANConst;
  1875.   CANConst = packed record           { Constant }
  1876.     nodeClass       : NODEClass;
  1877.     canOp           : CANOp;
  1878.     iType           : Word;          { Constant type. }
  1879.     iSize           : Word;          { Constant size. (in bytes) }
  1880.     iOffset         : Word;          { Offset in the literal pool. }
  1881.   end;
  1882.  
  1883.   pCANTuple = ^CANTuple;
  1884.   CANTuple = packed record           { Tuple (record) }
  1885.     nodeClass       : NODEClass;
  1886.     canOp           : CANOp;
  1887.     iSize           : Word;          { Record size. (in bytes) }
  1888.   end;
  1889.  
  1890.   pCANContinue = ^CANContinue;
  1891.   CANContinue = packed record        { Break Node                    (*) }
  1892.     nodeClass       : NODEClass;
  1893.     canOp           : CANOp;
  1894.     iContOperand    : Word;          { Continue if operand is true. }
  1895.   end;
  1896.  
  1897.   pCANCompare = ^CANCompare;
  1898.   CANCompare = packed record         { Extended compare Node (text fields) (*) }
  1899.     nodeClass       : NODEClass;
  1900.     canOp           : CANOp;         { canLIKE, canEQ }
  1901.     bCaseInsensitive : WordBool;     { 3 val: UNKNOWN = "fastest", "native" }
  1902.     iPartialLen     : Word;          { Partial fieldlength (0 is full length) }
  1903.     iOperand1       : Word;          { Byte offset of Op1 }
  1904.     iOperand2       : Word;          { Byte offset of Op2 }
  1905.   end;
  1906.  
  1907. {This is the node to be used to pass User defined functions }
  1908. const
  1909.   iLangSQL           = 0;            { Common SQL dialect }
  1910.   iDbaseExpr         = 2;            { This is also the driver ID for dBASE }
  1911.  
  1912. type
  1913.   pCANUdf = ^CANUdf;
  1914.   CANUdf = packed record             { A user defined function }
  1915.     nodeClass       : NODEClass;
  1916.     canOp           : CANOp;
  1917.     iOffSzFuncName  : Word;          { Offset in literal pool to Function Name string(0 terminated) }
  1918.     iOperands       : Word;          { Byte offset of Operands (concatenated using canCONT) }
  1919.     iDrvDialect     : Word;          { Driver Dialect ID for UDF string supplied }
  1920.     iOffSzUDF       : Word;          { Offset in literal pool to UDF string (0 terminated) }
  1921.   end;
  1922.  
  1923.   pCANNode = ^CANNode;
  1924.   CANNode = packed record
  1925.     case Integer of
  1926.       1: (canHdr      : CANHdr);
  1927.       2: (canUnary    : CANUnary);
  1928.       3: (canBinary   : CANBinary);
  1929.       4: (canField    : CANField);
  1930.       5: (canConst    : CANConst);
  1931.       6: (canTuple    : CANTuple);
  1932.       7: (canContinue : CANContinue);
  1933.       8: (canCompare  : CANCompare);
  1934.   end;
  1935.  
  1936. { Linear exression tree}
  1937. {----------------------}
  1938.  
  1939. const
  1940.   CANEXPRVERSION     = 2;
  1941.  
  1942. type
  1943.   ppCANExpr = ^pCANExpr;
  1944.   pCANExpr  = ^CANExpr;
  1945.   CANExpr   = packed record          { Expression Tree }
  1946.     iVer            : Word;          { Version tag of expression. }
  1947.     iTotalSize      : Word;          { Size of this structure }
  1948.     iNodes          : Word;          { Number of nodes }
  1949.     iNodeStart      : Word;          { Starting offet of Nodes in this }
  1950.     iLiteralStart   : Word;          { Starting offset of Literals in this }
  1951.   end;
  1952.  
  1953.  
  1954. {pfGENFilter returns TRUE, FALSE or ABORT }
  1955. const
  1956.   ABORT              = -2;
  1957.  
  1958. type
  1959.   pfGENFilter = function (
  1960.       ulClientData  : Longint;
  1961.       pRecBuf       : Pointer;
  1962.       iPhyRecNum    : Longint
  1963.    ): Integer;
  1964.  
  1965.   pFILTERInfo = ^FILTERInfo;
  1966.   FILTERInfo = packed record
  1967.     iFilterId       : Word;          { Id for filter }
  1968.     hFilter         : hDBIFilter;    { Filter handle }
  1969.     iClientData     : Longint;       { Client supplied data }
  1970.     iPriority       : Word;          { 1..N with 1 being highest }
  1971.     bCanAbort       : WordBool;      { TRUE : pfFilter can return ABORT }
  1972.     pfFilter        : pfGENFilter;   { Client filter function }
  1973.     pCanExpr        : Pointer;       { Supplied expression }
  1974.     bActive         : WordBool;      { TRUE : filter is active }
  1975.   end;
  1976.  
  1977. {----------------------------------------------------------------------------}
  1978. {   DBI Query related types                                                  }
  1979. {----------------------------------------------------------------------------}
  1980.  
  1981. const
  1982.   MAXQBEEXPRSIZE     = 300;          { size of one QBE expr }
  1983.  
  1984. {----------------------------------------------------------------------------}
  1985.  
  1986. type
  1987.   pDBIQryProp = ^DBIQryProp;
  1988.   DBIQryProp = packed record
  1989.     szQryName       : DBINAME;       { Name of query }
  1990.     eLang           : DBIQryLang;    { Language }
  1991.     iQryPrice       : Integer;       { Query price 1..100 (1 = cheap, 100 = expensive) }
  1992.     iNumTables      : Integer;       { Number of tables in join.  0 = unknown. }
  1993.     bHasAnswer      : WordBool;
  1994.     bInsert         : WordBool;
  1995.     bDelete         : WordBool;
  1996.     bChange         : WordBool;
  1997.   end;
  1998.  
  1999. {----------------------------------------------------------------------------}
  2000.  
  2001. const
  2002.   DBIQBE_ANSWERBIT   = ($1);         { Answer table bit flag }
  2003.   DBIQBE_INSERTEDBIT = ($2);         { Inserted table bit flag }
  2004.   DBIQBE_DELETEDBIT  = ($4);         { Deleted table bit flag }
  2005.   DBIQBE_CHANGEDBIT  = ($8);         { Changed table bit flag }
  2006.   DBIQBE_ERRORINSBIT = ($10);        { Error inserted table bit flag }
  2007.   DBIQBE_ERRORDELBIT = ($20);        { Error deleted table bit flag }
  2008.   DBIQBE_ERRORCHGBIT = ($40);        { Error changed table bit flag }
  2009.  
  2010.  
  2011. { answer cursor properties: }
  2012.   bAnsHasLiveFields  = $1;
  2013.   bAnsHasFilter      = $2;
  2014.   bAnsHasFieldMap    = $4;
  2015.   bAnsHasCalcField   = $8;
  2016.   bAnsHasLiveBlob    = $10;
  2017.  
  2018. { answer field properties: }
  2019.   bIsAnsFieldLive    = $1;
  2020.  
  2021. {----------------------------------------------------------------------------}
  2022.  
  2023. type
  2024. {$IFDEF VER80}
  2025.   DBIQryType = (
  2026.     dbiqryDEFAULT,
  2027.     dbiqryDIRTY,
  2028.     dbiqryCLEAN,
  2029.     dbiqryRESTART
  2030.   );
  2031. {$ELSE}
  2032.   DBIQryType = WordEnum;
  2033. const
  2034.     dbiqryDEFAULT = 0;
  2035.     dbiqryDIRTY   = 1;
  2036.     dbiqryCLEAN   = 2;
  2037.     dbiqryRESTART = 3;
  2038. {$ENDIF}
  2039.  
  2040. {----------------------------------------------------------------------------}
  2041.  
  2042. type
  2043.   pDBIQryProgress = ^DBIQryProgress;
  2044.   DBIQryProgress = packed record
  2045.     stepsInQry      : Word;          { Total steps in query. }
  2046.     stepsCompleted  : Word;          { Steps completed out of total (steps may be skipped). }
  2047.     totElemInStep   : Longint;       { Total elements in current step. }
  2048.     elemCompleted   : Longint;       { Elements completed in current step. }
  2049.   end;
  2050.  
  2051. { values for client indicating live/canned preference about query execution }
  2052.  
  2053. {$IFDEF VER80}
  2054.   QryEvalMode = (
  2055.     qryModeNone,                     { Reserved }
  2056.     qryModeLOCAL,
  2057.     qryModeSERVER,
  2058.     qryModeEITHER,
  2059.     qryModeNOWLOCAL                  { used only in call back, when failed on server }
  2060.   );
  2061.  
  2062.   LIVENESS = (
  2063.     wantDEFAULT,                     { Default , same as wantCANNED }
  2064.     wantLIVE,                        { Want live data even if extra effort (no guarantee) }
  2065.     wantCANNED,                      { Want canned data even if extra effort (guaranteed) }
  2066.     wantSPEED                        { Let query manager decide, find out afterwards }
  2067.   );
  2068. {$ELSE}
  2069.   QryEvalMode = WordEnum;
  2070. const
  2071.     qryModeNone     = 0;             { Reserved }
  2072.     qryModeLOCAL    = 1;
  2073.     qryModeSERVER   = 2;
  2074.     qryModeEITHER   = 3;
  2075.     qryModeNOWLOCAL = 4;             { used only in call back, when failed on server }
  2076.  
  2077. type
  2078.   LIVENESS = WordEnum;
  2079. const
  2080.     wantDEFAULT = 0;                 { Default , same as wantCANNED }
  2081.     wantLIVE    = 1;                 { Want live data even if extra effort (no guarantee) }
  2082.     wantCANNED  = 2;                 { Want canned data even if extra effort (guaranteed) }
  2083.     wantSPEED   = 3;                 { Let query manager decide, find out afterwards }
  2084. {$ENDIF}
  2085.  
  2086. type
  2087.   pQueryLowProps = ^QueryLowProps;
  2088.   QueryLowProps = packed record
  2089.     length          : Integer;       { Length in bytes of this structure }
  2090.     blankzeroes     : WordBool;      { TRUE if blanks to be regarded as zeros }
  2091.     dateFormat      : FMTDate;       { Date format }
  2092.     numberFormat    : FMTNumber;     { Number format }
  2093.     bNeedAuxTbls    : WordBool;      { if FALSE, don't bother with DELETED/ERRDEL, etc. }
  2094.     qryMode         : QryEvalMode;   { qryModeSERVER, qryModeLOCAL or qryModeEITHER. }
  2095.     perQrySqlMode   : WordBool;
  2096.     livenessDesired : LIVENESS;
  2097.   end;
  2098.  
  2099. {============================================================================}
  2100. {                      DBI symbols                                           }
  2101. {============================================================================}
  2102.  
  2103. const
  2104.   DBIMOD_BEGIN       = ($3F00);
  2105.  
  2106.   DBIMOD_QBE         = (DBIMOD_BEGIN + 1);
  2107.   DBIMOD_SQLG        = (DBIMOD_BEGIN + 2);
  2108.   DBIMOD_LEGO        = (DBIMOD_BEGIN + 3);
  2109.   DBIMOD_LOCKMNGR    = (DBIMOD_BEGIN + 4);
  2110.   DBIMOD_SQLDRIVER   = (DBIMOD_BEGIN + 5);
  2111.   DBIMOD_OS          = (DBIMOD_BEGIN + 6);
  2112.   DBIMOD_DBASEDRV    = (DBIMOD_BEGIN + 7);
  2113.  
  2114.   DBIMOD_END         = (DBIMOD_BEGIN + 8);
  2115.  
  2116. {----------------------------------------------------------------------------}
  2117.  
  2118.   DBISYM_BEGIN       = (DBIMOD_END + 1);
  2119.  
  2120.   DBISYM_TOKEN       = (DBISYM_BEGIN + ecTOKEN);
  2121.   DBISYM_TABLENAME   = (DBISYM_BEGIN + ecTABLENAME);
  2122.   DBISYM_FIELDNAME   = (DBISYM_BEGIN + ecFIELDNAME);
  2123.   DBISYM_IMAGEROW    = (DBISYM_BEGIN + ecIMAGEROW);
  2124.   DBISYM_USERNAME    = (DBISYM_BEGIN + ecUSERNAME);
  2125.   DBISYM_FILENAME    = (DBISYM_BEGIN + ecFILENAME);
  2126.   DBISYM_INDEXNAME   = (DBISYM_BEGIN + ecINDEXNAME);
  2127.   DBISYM_DIRNAME     = (DBISYM_BEGIN + ecDIRNAME);
  2128.   DBISYM_KEYNAME     = (DBISYM_BEGIN + ecKEYNAME);
  2129.   DBISYM_ALIAS       = (DBISYM_BEGIN + ecALIAS);
  2130.   DBISYM_DRIVENAME   = (DBISYM_BEGIN + ecDRIVENAME);
  2131.   DBISYM_NATIVECODE  = (DBISYM_BEGIN + ecNATIVECODE);
  2132.   DBISYM_NATIVEMSG   = (DBISYM_BEGIN + ecNATIVEMSG);
  2133.   DBISYM_LINENUMBER  = (DBISYM_BEGIN + ecLINENUMBER);
  2134.   DBISYM_CAPABILITY  = (DBISYM_BEGIN + ecCAPABILITY);
  2135.   DBISYM_INTERNALLIMIT=(DBISYM_BEGIN + ecINTERNALLIMIT);
  2136.  
  2137.   DBISYM_BASEEND     = (DBISYM_BEGIN + 100);
  2138.  
  2139. {----------------------------------------------------------------------------}
  2140.  
  2141.   DBISYM_MISC        = (DBISYM_BASEEND + 1);
  2142.  
  2143.   DBISYM_WORK        = (DBISYM_MISC + 1);
  2144.   DBISYM_PRIV        = (DBISYM_MISC + 2);
  2145.   DBISYM_COPY        = (DBISYM_MISC + 3);
  2146.   DBISYM_APPEND      = (DBISYM_MISC + 4);
  2147.  
  2148.   DBISYM_END         = (DBIMOD_BEGIN + $3FFF);
  2149.  
  2150.  
  2151. {============================================================================}
  2152. {                      DBI Config symbols                                    }
  2153. {============================================================================}
  2154.  
  2155. { Categories }
  2156.  
  2157.   szCFGSYSTEM        = 'SYSTEM';
  2158.   szCFGDRIVER        = 'DRIVERS';
  2159.   szCFGDATABASE      = 'DATABASES';
  2160.  
  2161. {----------------------------------------------------------------------------}
  2162. { System Fields                                                              }
  2163. {----------------------------------------------------------------------------}
  2164.  
  2165.   szCFGSYSVERSION    = 'VERSION';
  2166.   szCFGSYSNETTYPE    = 'NET TYPE';
  2167.   szCFGSYSNETDIR     = 'NET DIR';
  2168.   szCFGSYSLOCALSHARE = 'LOCAL SHARE';
  2169.   szCFGSYSLANGDRV    = 'LANGDRIVER';
  2170.   szCFGSYSLANGDRVDIR = 'LANGDRVDIR';
  2171.   szCFGSYSMINBUF     = 'MINBUFSIZE';
  2172.   szCFGSYSMAXBUF     = 'MAXBUFSIZE';
  2173.   szCFGSYSLOCKRETRY  = 'LOCKRETRY';
  2174.   szCFGSYSFLAGS      = 'SYSFLAGS';
  2175.   szCFGMAXFILEHANDLES = 'MAXFILEHANDLES';
  2176.   szCFGSQLQRYMODE    = 'SQLQRYMODE';
  2177.   szCFGLOWMEMLIMIT   = 'LOW MEMORY USAGE LIMIT'; { Use this instead of NOLOWMEMBUF }
  2178.   szCFGSYSODBCCFGIMPORT = 'AUTO ODBC';
  2179.   szCFGSYSDEFDRV     = 'DEFAULT DRIVER';
  2180.  
  2181. {----------------------------------------------------------------------------}
  2182. { Driver Fields                                                              }
  2183. {----------------------------------------------------------------------------}
  2184.  
  2185.   szCFGDRVVERSION    = 'VERSION';
  2186.   szCFGDRVTYPE       = 'TYPE';
  2187.   szCFGDRVDLL        = 'DLL';
  2188.   szCFGDRVFLAGS      = 'DRIVER FLAGS';
  2189.   szCFGDRVLANGDRIVER = 'LANGDRIVER';
  2190.   szCFGDRVFILLFACTOR = 'FILL FACTOR';
  2191.   szCFGDRVBLOCKSIZE  = 'BLOCK SIZE';
  2192.   szCFGDRVLOCKPROTOCOL = 'LOCKPROTOCOL';
  2193.   szCFGDRVLEVEL      = 'LEVEL';
  2194.   szCFGDRVVENDINIT   = 'VENDOR INIT';
  2195.  
  2196. {----------------------------------------------------------------------------}
  2197. { Dbase Driver fields                                                        }
  2198. {----------------------------------------------------------------------------}
  2199.  
  2200.   szCFGDRVMEMOBLOCKSIZE = 'MEMO FILE BLOCK SIZE';
  2201.   szCFGDRVMDXBLOCKSIZE = 'MDX BLOCK SIZE';
  2202.  
  2203.  
  2204. {----------------------------------------------------------------------------}
  2205. { Driver Nodes                                                               }
  2206. {----------------------------------------------------------------------------}
  2207.  
  2208.   szCFGDRVINIT       = 'INIT';
  2209.   szCFGDBCREATE      = 'DB CREATE';
  2210.   szCFGDBOPEN        = 'DB OPEN';
  2211.   szCFGTBLCREATE     = 'TABLE CREATE';
  2212.   szCFGTBLOPEN       = 'TABLE OPEN';
  2213.  
  2214. {----------------------------------------------------------------------------}
  2215. { Database Nodes                                                             }
  2216. {----------------------------------------------------------------------------}
  2217.  
  2218.   szCFGDBINFO        = 'DB INFO';
  2219.  
  2220. {----------------------------------------------------------------------------}
  2221. { Database fields                                                            }
  2222. {----------------------------------------------------------------------------}
  2223.  
  2224.   szCFGDBTYPE        = 'TYPE';
  2225.   szCFGDBPATH        = 'PATH';
  2226.   szCFGDBDEFAULTDRIVER = 'DEFAULT DRIVER';
  2227.  
  2228. {----------------------------------------------------------------------------}
  2229. { Others                                                                     }
  2230. {----------------------------------------------------------------------------}
  2231.  
  2232.   szCFGINIT          = 'INIT';
  2233.   szTYPE             = 'TYPE';
  2234.   szCFGDBSTANDARD    = 'STANDARD';
  2235.   szCFGTRUE          = 'TRUE';
  2236.   szCFGFALSE         = 'FALSE';
  2237.   szOPENMODE         = 'OPEN MODE';
  2238.   szREADWRITE        = 'READ/WRITE';
  2239.   szREADONLY         = 'READ ONLY';
  2240.   szSHAREMODE        = 'SHARE MODE';
  2241.   szEXCLUSIVE        = 'EXCLUSIVE';
  2242.   szSHARED           = 'SHARED';
  2243.   szUSERNAME         = 'USER NAME';
  2244.   szSERVERNAME       = 'SERVER NAME';
  2245.   szDATABASENAME     = 'DATABASE NAME';
  2246.   szSCHEMASIZE       = 'SCHEMA CACHE SIZE';
  2247.   szCFGSTRICTINTEGRITY = 'STRICTINTEGRTY';
  2248.   szSQLPASSMODE      = 'SQLPASSTHRU MODE';
  2249.   szNOTSHARED        = 'NOT SHARED';
  2250.   szSHAREDAUTOCOMMIT = 'SHARED AUTOCOMMIT';
  2251.   szSHAREDNOAUTOCOMMIT = 'SHARED NOAUTOCOMMIT';
  2252.   szSCHEMATIME       = 'SCHEMA CACHE TIME';
  2253.   szMAXQUERYTIME     = 'MAX QUERY TIME';
  2254.  
  2255.  
  2256. {----------------------------------------------------------------------------}
  2257. { SYSTEM DATE/TIME/NUMBER FORMATS                                            }
  2258. { SYSTEM nodes:                                                              }
  2259. {----------------------------------------------------------------------------}
  2260.   szCFGFORMAT        = 'FORMATS';
  2261.  
  2262. {----------------------------------------------------------------------------}
  2263. { Format nodes:                                                              }
  2264. {----------------------------------------------------------------------------}
  2265.   szCFGDATE          = 'DATE';
  2266.   szCFGTIME          = 'TIME';
  2267.   szCFGNUMBER        = 'NUMBER';
  2268.  
  2269. {----------------------------------------------------------------------------}
  2270. { DATE and/or TIME fields:                                                   }
  2271. {----------------------------------------------------------------------------}
  2272.   szCFGSEPARATOR     = 'SEPARATOR';
  2273.   szCFGMODE          = 'MODE';
  2274.   szCFGFOURDIGITYEAR = 'FOURDIGITYEAR';
  2275.   szCFGYEARBIASED    = 'YEARBIASED';
  2276.   szCFGLEADINGZEROM  = 'LEADINGZEROM';
  2277.   szCFGLEADINGZEROD  = 'LEADINGZEROD';
  2278.   szCFGTWELVEHOUR    = 'TWELVEHOUR';
  2279.   szCFGAMSTRING      = 'AMSTRING';
  2280.   szCFGPMSTRING      = 'PMSTRING';
  2281.   szCFGSECONDS       = 'SECONDS';
  2282.   szCFGMILSECONDS    = 'MILSECONDS';
  2283.  
  2284. {----------------------------------------------------------------------------}
  2285. { Number fields:                                                             }
  2286. {----------------------------------------------------------------------------}
  2287.   szCFGDECIMALSEPARATOR = 'DECIMALSEPARATOR';
  2288.   szCFGTHOUSANDSEPARATOR = 'THOUSANDSEPARATOR';
  2289.   szCFGDECIMALDIGITS = 'DECIMALDIGITS';
  2290.   szCFGLEADINGZERON  = 'LEADINGZERON';
  2291.  
  2292. { String resoure id's for each string listed above }
  2293.  
  2294.   DBICFG_BASE        = $3A00;
  2295.  
  2296. {----------------------------------------------------------------------------}
  2297. { Categories                                                                 }
  2298. {----------------------------------------------------------------------------}
  2299.   iCFGSYSTEM         = (DBICFG_BASE + 1);
  2300.   iCFGDRIVER         = (DBICFG_BASE + 2);
  2301.   iCFGDATABASE       = (DBICFG_BASE + 3);
  2302.  
  2303. {----------------------------------------------------------------------------}
  2304. { System Fields                                                              }
  2305. {----------------------------------------------------------------------------}
  2306.   iCFGSYSVERSION     = (DBICFG_BASE + 5);
  2307.   iCFGSYSNETTYPE     = (DBICFG_BASE + 6);
  2308.   iCFGSYSNETDIR      = (DBICFG_BASE + 7);
  2309.   iCFGSYSLOCALSHARE  = (DBICFG_BASE + 8);
  2310.   iCFGSYSLANGDRV     = (DBICFG_BASE + 9);
  2311.   iCFGSYSLANGDRVDIR  = (DBICFG_BASE + 10);
  2312.   iCFGSYSMINBUF      = (DBICFG_BASE + 11);
  2313.   iCFGSYSMAXBUF      = (DBICFG_BASE + 12);
  2314.   iCFGSYSLOCKRETRY   = (DBICFG_BASE + 13);
  2315.   iCFGSYSFLAGS       = (DBICFG_BASE + 14);
  2316.   iCFGMAXFILEHANDLES = (DBICFG_BASE + 15);
  2317.   iCFGSQLQRYMODE     = (DBICFG_BASE + 16);
  2318.   iCFGLOWMEMLIMIT    = (DBICFG_BASE + 17);
  2319.   iCFGSYSODBCCFGIMPORT=(DBICFG_BASE + 18);
  2320.   iCFGSYSDEFDRV      = (DBICFG_BASE + 19);
  2321.  
  2322.  
  2323. {----------------------------------------------------------------------------}
  2324. { Driver Fields                                                              }
  2325. {----------------------------------------------------------------------------}
  2326.   iCFGDRVVERSION     = (DBICFG_BASE + 20);
  2327.   iCFGDRVTYPE        = (DBICFG_BASE + 21);
  2328.   iCFGDRVLANGDRIVER  = (DBICFG_BASE + 22);
  2329.   iCFGDRVFILLFACTOR  = (DBICFG_BASE + 23);
  2330.   iCFGDRVBLOCKSIZE   = (DBICFG_BASE + 24);
  2331.   iCFGDRVLOCKPROTOCOL = (DBICFG_BASE + 25);
  2332.   iCFGDRVLEVEL       = (DBICFG_BASE + 26);
  2333.   iCFGDRVFLAGS       = (DBICFG_BASE + 27);
  2334.  
  2335. {----------------------------------------------------------------------------}
  2336. { Dbase Driver fields                                                        }
  2337. {----------------------------------------------------------------------------}
  2338.   iCFGDRVMEMOBLOCKSIZE = (DBICFG_BASE + 30 );
  2339.   iCFGDRVMDXBLOCKSIZE = (DBICFG_BASE + 31 );
  2340.  
  2341.  
  2342.  
  2343. {----------------------------------------------------------------------------}
  2344. { Driver Nodes                                                               }
  2345. {----------------------------------------------------------------------------}
  2346.   iCFGDRVINIT        = (DBICFG_BASE + 40 );
  2347.   iCFGDBCREATE       = (DBICFG_BASE + 41 );
  2348.   iCFGDBOPEN         = (DBICFG_BASE + 42 );
  2349.   iCFGTBLCREATE      = (DBICFG_BASE + 43 );
  2350.   iCFGTBLOPEN        = (DBICFG_BASE + 44 );
  2351.  
  2352. {----------------------------------------------------------------------------}
  2353. { Database Nodes                                                             }
  2354. {----------------------------------------------------------------------------}
  2355.   iCFGDBINFO         = (DBICFG_BASE + 50 );
  2356.  
  2357. {----------------------------------------------------------------------------}
  2358. { Database fields                                                            }
  2359. {----------------------------------------------------------------------------}
  2360.   iCFGDBTYPE         = (DBICFG_BASE + 60);
  2361.   iCFGDBPATH         = (DBICFG_BASE + 61);
  2362.   iCFGDBDEFAULTDRIVER= (DBICFG_BASE + 62);
  2363.  
  2364. {----------------------------------------------------------------------------}
  2365. { Others                                                                     }
  2366. {----------------------------------------------------------------------------}
  2367.   iCFGINIT           = (DBICFG_BASE + 70);
  2368.   iTYPE              = (DBICFG_BASE + 71);
  2369.   iCFGDBSTANDARD     = (DBICFG_BASE + 72);
  2370.   iCFGTRUE           = (DBICFG_BASE + 73);
  2371.   iCFGFALSE          = (DBICFG_BASE + 74);
  2372.   iOPENMODE          = (DBICFG_BASE + 75);
  2373.   iREADWRITE         = (DBICFG_BASE + 76);
  2374.   iREADONLY          = (DBICFG_BASE + 77);
  2375.   iSHAREMODE         = (DBICFG_BASE + 78);
  2376.   iEXCLUSIVE         = (DBICFG_BASE + 79);
  2377.   iSHARED            = (DBICFG_BASE + 80);
  2378.   iUSERNAME          = (DBICFG_BASE + 81);
  2379.   iSERVERNAME        = (DBICFG_BASE + 82);
  2380.   iDATABASENAME      = (DBICFG_BASE + 83);
  2381.   iSCHEMASIZE        = (DBICFG_BASE + 84);
  2382.   iCFGSTRICTINTEGRITY = (DBICFG_BASE + 85);
  2383.  
  2384. {----------------------------------------------------------------------------}
  2385. { System node:                                                               }
  2386. {----------------------------------------------------------------------------}
  2387.   iCFGFORMAT         = (DBICFG_BASE + 130);
  2388.  
  2389. {----------------------------------------------------------------------------}
  2390. { Format nodes:                                                              }
  2391. {----------------------------------------------------------------------------}
  2392.   iCFGDATE           = (DBICFG_BASE + 131);
  2393.   iCFGTIME           = (DBICFG_BASE + 132);
  2394.   iCFGNUMBER         = (DBICFG_BASE + 133);
  2395.  
  2396. {----------------------------------------------------------------------------}
  2397. { DATE and/or TIME fields:                                                   }
  2398. {----------------------------------------------------------------------------}
  2399.   iCFGSEPARATOR      = (DBICFG_BASE + 140);
  2400.   iCFGMODE           = (DBICFG_BASE + 141);
  2401.   iCFGFOURDIGITYEAR  = (DBICFG_BASE + 142);
  2402.   iCFGYEARBIASED     = (DBICFG_BASE + 143);
  2403.   iCFGLEADINGZEROM   = (DBICFG_BASE + 144);
  2404.   iCFGLEADINGZEROD   = (DBICFG_BASE + 145);
  2405.   iCFGTWELVEHOUR     = (DBICFG_BASE + 146);
  2406.   iCFGAMSTRING       = (DBICFG_BASE + 147);
  2407.   iCFGPMSTRING       = (DBICFG_BASE + 148);
  2408.   iCFGSECONDS        = (DBICFG_BASE + 149);
  2409.   iCFGMILSECONDS     = (DBICFG_BASE + 150);
  2410.  
  2411. {----------------------------------------------------------------------------}
  2412. { Number fields:                                                             }
  2413. {----------------------------------------------------------------------------}
  2414.   iCFGDECIMALSEPARATOR = (DBICFG_BASE + 160);
  2415.   iCFGTHOUSANDSEPARATOR = (DBICFG_BASE + 161);
  2416.   iCFGDECIMALDIGITS  = (DBICFG_BASE + 162);
  2417.   iCFGLEADINGZERON   = (DBICFG_BASE + 163);
  2418.  
  2419.   iCFGDEFLANGDRV     = (DBICFG_BASE + 165);
  2420.   iCFGDBASEDEFLANGDRV = (DBICFG_BASE + 166);
  2421.  
  2422. {----------------------------------------------------------------------------}
  2423. { Formats                                                                    }
  2424. {----------------------------------------------------------------------------}
  2425.   iCFGDEFSEPARATOR   = (DBICFG_BASE + 170);
  2426.   iCFGDEFMODE        = (DBICFG_BASE + 171);
  2427.   iCFGDEFFOURDIGITYEAR = (DBICFG_BASE + 172);
  2428.   iCFGDEFYEARBIASED  = (DBICFG_BASE + 173);
  2429.   iCFGDEFLEADINGZEROM = (DBICFG_BASE + 174);
  2430.   iCFGDEFLEADINGZEROD = (DBICFG_BASE + 175);
  2431.   iCFGDEFTWELVEHOUR  = (DBICFG_BASE + 176);
  2432.   iCFGDEFAMSTRING    = (DBICFG_BASE + 177);
  2433.   iCFGDEFPMSTRING    = (DBICFG_BASE + 178);
  2434.   iCFGDEFSECONDS     = (DBICFG_BASE + 179);
  2435.   iCFGDEFMILSECONDS  = (DBICFG_BASE + 180);
  2436.   iCFGDEFDECIMALSEPARATOR = (DBICFG_BASE + 181);
  2437.   iCFGDEFTHOUSANDSEPARATOR = (DBICFG_BASE + 182);
  2438.   iCFGDEFLEADINGZERO = (DBICFG_BASE + 183);
  2439.  
  2440. implementation
  2441.  
  2442. end.
  2443.