home *** CD-ROM | disk | FTP | other *** search
-
- {*******************************************************}
- { }
- { BDE Data types }
- { }
- { Copyright (c) 1995 Borland International }
- { }
- {*******************************************************}
-
- unit DbiTypes;
-
- {$IFDEF VER80}
- {$Z+} { Word Sized Enums }
- {$ENDIF}
-
- interface
-
- uses Wintypes;
-
- { sdk debug layer defines }
-
- const
- DEBUGON = $1;
- OUTPUTTOFILE = $2;
- FLUSHEVERYOP = $8;
- APPENDTOLOG = $10;
-
- { Constants }
-
- DBIMAXNAMELEN = 31; { Name limit (table, field etc) }
- DBIMAXSPNAMELEN = 64; { Max stored procedure name length }
- DBIMAXFLDSINKEY = 16; { Max fields in a key }
- DBIMAXKEYEXPLEN = 220; { Max Key expression length }
- DBIMAXEXTLEN = 3; { Max file extension len, not incl. dot }
- DBIMAXTBLNAMELEN = 127; { Max table name length }
- DBIMAXDRIVELEN = 2; { Max drive length }
- DBIMAXPATHLEN = 81; { Max path+file name len (excluding zero termination) }
- DBIMAXMSGLEN = 127; { Max message len (allocate 128) }
- DBIMAXVCHKLEN = 255; { Max val check len }
- DBIMAXPICTLEN = 175; { Max picture len //Verify this - VJ }
- DBIMAXFLDSINSEC = 256; { Max fields in security spec }
-
- DBIMAXSCFIELDS = 16; { max nbr of fields in a config section }
- DBIMAXSCFLDLEN = 128; { max field length }
- DBIMAXSCRECSIZE = 2048; { max rec size }
-
- DBIMAXUSERNAMELEN = 14; { Max user name (general) }
- DBIMAXXBUSERNAMELEN = 12; { Max user name length (xBASE) }
- DBIMAXBOOKMARKLEN = 4104; { Max Bookmark length }
-
- {============================================================================}
- { G e n e r a l }
- {============================================================================}
-
- type
- DATE = Longint;
- TIME = Longint;
- TIMESTAMP = Double;
- DBIResult = Word; { Function result }
- WordEnum = Word;
- PLocale = Pointer;
-
- { Handle Types }
-
- _hDBIObj = record end; { Dummy structure to create "typed" handles }
- hDBIObj = ^_hDBIObj; { Generic object handle }
- hDBIDb = ^_hDBIObj; { Database handle }
- hDBIQry = ^_hDBIObj; { Query handle }
- hDBIStmt = ^_hDBIObj; { Statement handle ("new query") }
- hDBICur = ^_hDBIObj; { Cursor handle }
- hDBISes = ^_hDBIObj; { Session handle }
- hDBIXlt = ^_hDBIObj; { Translation handle }
- hDBICfg = ^_hDBIObj; { Configuration handle }
- hDBIXact = ^_hDBIObj; { Transaction handle }
- hDBIFilter = ^_hDBIObj; { Filter handle }
-
- { Handle Pointers }
-
- phDBIObj = ^hDBIObj; { Pointer to Generic object handle }
- phDBIDb = ^hDBIDb; { Pointer to Database handle }
- phDBIQry = ^hDBIQry; { Pointer to Query handle }
- phDBIStmt = ^hDBIStmt; { Pointer to Statement handle }
- phDBICur = ^hDBICur; { Pointer to Cursor handle }
- phDBISes = ^hDBISes; { Pointer to Session handle }
- phDBIXlt = ^hDBIXlt; { Pointer to Translation handle }
- phDBICfg = ^hDBICfg; { Pointer to Configuration handle }
- phDBIXact = ^hDBIXact; { Pointer to Transaction handle }
- phDBIFilter = ^hDBIFilter; { Pointer to Filter handle }
-
- { typedefs for buffers of various common sizes: }
-
- DBIPATH = packed array [0..DBIMAXPATHLEN] of Char; { holds a DOS path }
- DBINAME = packed array [0..DBIMAXNAMELEN] of Char; { holds a name }
- DBIEXT = packed array [0..DBIMAXEXTLEN] of Char; { holds an extension EXT }
- DBIDOTEXT = packed array [0..DBIMAXEXTLEN+1] of Char; { holds an extension EXT including '.' }
- DBIDRIVE = packed array [0..DBIMAXDRIVELEN] of Char; { holds a drive name }
- DBITBLNAME = packed array [0..DBIMAXTBLNAMELEN] of Char; { holds a table name }
- DBISPNAME = packed array [0..DBIMAXSPNAMELEN] of Char; { holds a stored procedure name }
- DBIUSERNAME = packed array [0..DBIMAXUSERNAMELEN] of Char; { holds a user name }
- DBIKEY = packed array [0..DBIMAXFLDSINKEY - 1] of Word; { holds list of fields in a key }
- DBIKEYEXP = packed array [0..DBIMAXKEYEXPLEN] of Char; { holds a key expression }
- DBIVCHK = packed array [0..DBIMAXVCHKLEN] of Byte; { holds a validity check }
- DBIPICT = packed array [0..DBIMAXPICTLEN] of Char; { holds a picture (Pdox) }
- DBIMSG = packed array [0..DBIMAXMSGLEN] of Char; { holds an error message }
-
-
- {============================================================================}
- { Environmental }
- {============================================================================}
-
- type
- pDBIEnv = ^DBIEnv;
- DBIEnv = packed record { Struct for defining the environ. }
- szWorkDir : DBIPATH; { Working directory }
- szIniFile : DBIPATH; { Configuration file }
- bForceLocalInit : WordBool; { Force local initialization }
- szLang : DBINAME; { System language driver }
- szClientName : DBINAME; { Client name }
- end;
-
- {============================================================================}
- { System Info }
- {============================================================================}
-
- type
- pSYSVersion = ^SYSVersion;
- SYSVersion = packed record { System Version Info }
- iVersion : Word; { Engine version }
- iIntfLevel : Word; { Client Interface level }
- dateVer : Date; { Version date (Compile/Release) }
- timeVer : Time; { Version time (Compile/Release) }
- end;
-
- pSYSConfig = ^SYSConfig;
- SYSConfig = packed record { System configuration (basic) }
- bLocalShare : WordBool; { If Local files will be shared }
- iNetProtocol : Word; { Net Protocol (35, 40 etc.) }
- bNetShare : WordBool; { True if connected to network }
- szNetType : DBINAME; { Network type }
- szUserName : DBIUSERNAME; { Network user name }
- szIniFile : DBIPATH; { Configuration file }
- szLangDriver : DBINAME; { System language driver }
- end;
-
- pSYSInfo = ^SYSInfo;
- SYSInfo = packed record { System Status/Info }
- iBufferSpace : Word; { in K }
- iHeapSpace : Word; { in K }
- iDrivers : Word; { Active/Loaded drivers }
- iClients : Word; { Active clients }
- iSessions : Word; { Number of sessions (For all clients) }
- iDatabases : Word; { Open databases }
- iCursors : Word; { Number of cursors }
- end;
-
- pCLIENTInfo = ^CLIENTInfo;
- CLIENTInfo = packed record
- szName : DBINAME; { Documentary name }
- iSessions : Word; { Number of sessions }
- szWorkDir : DBIPATH; { Working directory }
- szLang : DBINAME; { System language driver (Client supplied) }
- end;
-
- pSESInfo = ^SESInfo;
- SESInfo = packed record
- iSession : Word; { Session id (1..n) }
- szName : DBINAME; { Documentary name }
- iDatabases : Word; { Open databases }
- iCursors : Word; { Open cursors }
- iLockWait : Integer; { Lock wait time (in seconds) }
- szNetDir : DBIPATH; { Net directory location }
- szPrivDir : DBIPATH; { Current Private directory }
- end;
-
- {============================================================================}
- { Table / Field Types }
- {============================================================================}
-
- { Driver Types }
-
- const
- szPARADOX = 'PARADOX';
- szDBASE = 'DBASE';
- szASCII = 'ASCIIDRV';
-
-
- { Field Types (Logical) }
-
- fldUNKNOWN = 0;
- fldZSTRING = 1; { Null terminated string }
- fldDATE = 2; { Date (32 bit) }
- fldBLOB = 3; { Blob }
- fldBOOL = 4; { Boolean (16 bit) }
- fldINT16 = 5; { 16 bit signed number }
- fldINT32 = 6; { 32 bit signed number }
- fldFLOAT = 7; { 64 bit floating point }
- fldBCD = 8; { BCD }
- fldBYTES = 9; { Fixed number of bytes }
- fldTIME = 10; { Time (32 bit) }
- fldTIMESTAMP = 11; { Time-stamp (64 bit) }
- fldUINT16 = 12; { Unsigned 16 bit integer }
- fldUINT32 = 13; { Unsigned 32 bit integer }
- fldFLOATIEEE = 14; { 80-bit IEEE float }
- fldVARBYTES = 15; { Length prefixed var bytes }
- fldLOCKINFO = 16; { Look for LOCKINFO typedef }
-
- MAXLOGFLDTYPES = 17; { Number of logical fieldtypes }
-
- { Sub Types }
-
- { fldFLOAT subtype }
-
- fldstMONEY = 21; { Money }
-
- { fldBLOB subtypes }
-
- fldstMEMO = 22; { Text Memo }
- fldstBINARY = 23; { Binary data }
- fldstFMTMEMO = 24; { Formatted Text }
- fldstOLEOBJ = 25; { OLE object (Paradox) }
- fldstGRAPHIC = 26; { Graphics object }
- fldstDBSOLEOBJ = 27; { dBASE OLE object }
- fldstTYPEDBINARY = 28; { Typed Binary data }
-
- { fldZSTRING subtype }
-
- fldstPASSWORD = 1; { Password }
-
- { fldINT32 subtype }
-
- fldstAUTOINC = 29;
-
- { Paradox types (Physical) }
-
- fldPDXCHAR = $101; { Alpha (string) }
- fldPDXNUM = $102; { Numeric }
- fldPDXMONEY = $103; { Money }
- fldPDXDATE = $104; { Date }
- fldPDXSHORT = $105; { Short }
- fldPDXMEMO = $106; { Text Memo (blob) }
- fldPDXBINARYBLOB = $107; { Binary data (blob) }
- fldPDXFMTMEMO = $108; { Formatted text (blob) }
- fldPDXOLEBLOB = $109; { OLE object (blob) }
- fldPDXGRAPHIC = $10A; { Graphics object (blob) }
- fldPDXBLOB = fldPDXMEMO;
- fldPDXLONG = $10B; { Long }
- fldPDXTIME = $10C; { Time }
- fldPDXDATETIME = $10D; { Time Stamp }
- fldPDXBOOL = $10E; { Logical }
- fldPDXAUTOINC = $10F; { Auto increment (long) }
- fldPDXBYTES = $110; { Fixed number of bytes }
- fldPDXBCD = $111; { BCD (32 digits) }
- fldPDXUNICHAR = $112; { not supported yet }
-
- { xBASE types (Physical) }
-
- fldDBCHAR = $201; { Char string }
- fldDBNUM = $202; { Number }
- fldDBMEMO = $203; { Memo (blob) }
- fldDBBOOL = $204; { Logical }
- fldDBDATE = $205; { Date }
- fldDBFLOAT = $206; { Float }
- fldDBLOCK = $207; { Logical type is LOCKINFO }
- fldDBOLEBLOB = $208; { OLE object (blob) }
- fldDBBINARY = $209; { Binary data (blob) }
- fldDBBYTES = $20A; { Only for TEMPORARY tables }
-
- { xBASE key types (Cannot be used as field types) }
-
- fldDBKEYNUM = $210;
- fldDBKEYBCD = $211;
-
-
- { Ascii types (Physical) }
-
- fldASCCHAR = $301; { Char string }
- fldASCNUM = $302; { Number }
- fldASCBOOL = $303; { Logical }
- fldASCDATE = $304; { Date }
- fldASCFLOAT = $305; { Float }
- fldASCLOCK = $306; { Not used }
- fldASCTIMESTAMP = $307; { TimeStamp }
- fldASCTIME = $308; { Time }
- fldASCLONG = $309; { Long }
- fldASCMONEY = $30A; { Money }
-
-
- {============================================================================}
- { Field descriptor }
- {============================================================================}
-
-
- type
- {$IFDEF VER80}
- FLDVchk = ( { Field Val Check type }
- fldvNOCHECKS, { Does not have explicit val checks }
- fldvHASCHECKS, { One or more val checks on the field }
- fldvUNKNOWN { Dont know at this time }
- );
-
- type
- FLDRights = ( { Field Rights }
- fldrREADWRITE, { Field can be Read/Written }
- fldrREADONLY, { Field is Read only }
- fldrNONE, { No Rights on this field }
- fldrUNKNOWN { Dont know at this time }
- );
- {$ELSE}
- FLDVchk = WordEnum; { Field Val Check type }
- const
- fldvNOCHECKS = 0; { Does not have explicit val checks }
- fldvHASCHECKS = 1; { One or more val checks on the field }
- fldvUNKNOWN = 2; { Dont know at this time }
-
- type
- FLDRights = WordEnum; { Field Rights }
- const
- fldrREADWRITE = 0; { Field can be Read/Written }
- fldrREADONLY = 1; { Field is Read only }
- fldrNONE = 2; { No Rights on this field }
- fldrUNKNOWN = 3; { Dont know at this time }
- {$ENDIF}
-
- type
- pFLDDesc = ^FLDDesc;
- FLDDesc = packed record { Field Descriptor }
- iFldNum : Word; { Field number (1..n) }
- szName : DBINAME; { Field name }
- iFldType : Word; { Field type }
- iSubType : Word; { Field subtype (if applicable) }
- iUnits1 : Integer; { Number of Chars, digits etc }
- iUnits2 : Integer; { Decimal places etc. }
- iOffset : Word; { Offset in the record (computed) }
- iLen : Word; { Length in bytes (computed) }
- iNullOffset : Word; { For Null bits (computed) }
- efldvVchk : FLDVchk; { Field Has vcheck (computed) }
- efldrRights : FLDRights; { Field Rights (computed) }
- end;
-
- {============================================================================}
- { Index descriptor }
- {============================================================================}
-
- type
- pIDXDesc = ^IDXDesc;
- IDXDesc = packed record { Index description }
- szName : DBITBLNAME; { Index name }
- iIndexId : Word; { Index number }
- szTagName : DBINAME; { Tag name (for dBASE) }
- szFormat : DBINAME; { Optional format (BTREE, HASH etc) }
- bPrimary : WordBool; { True, if primary index }
- bUnique : WordBool; { True, if unique keys }
- bDescending : WordBool; { True, for descending index }
- bMaintained : WordBool; { True, if maintained index }
- bSubset : WordBool; { True, if subset index }
- bExpIdx : WordBool; { True, if expression index }
- iCost : Word; { Not used }
- iFldsInKey : Word; { Fields in the key (1 for Exp) }
- iKeyLen : Word; { Phy Key length in bytes (Key only) }
- bOutofDate : WordBool; { True, if index out of date }
- iKeyExpType : Word; { Key type of Expression }
- aiKeyFld : DBIKEY; { Array of field numbers in key }
- szKeyExp : DBIKEYEXP; { Key expression }
- szKeyCond : DBIKEYEXP; { Subset condition }
- bCaseInsensitive : WordBool; { True, if case insensitive index }
- iBlockSize : Word; { Block size in bytes }
- iRestrNum : Word; { Restructure number }
- iUnUsed : packed array [0..15] of Word;
- end;
-
- {============================================================================}
- { Validity check, Referential integrity descriptors }
- {============================================================================}
-
-
-
- { Subtypes for Lookup }
-
- {$IFDEF VER80}
- LKUPType = ( { Paradox Lookup type }
- lkupNONE, { Has no lookup }
- lkupPRIVATE, { Just Current Field + Private }
- lkupALLCORRESP, { All Corresponding + No Help }
- lkupHELP, { Just Current Fld + Help and Fill }
- lkupALLCORRESPHELP { All Corresponging + Help }
- );
-
- RINTType = ( { Ref integrity type }
- rintMASTER, { This table is Master }
- rintDEPENDENT { This table is Dependent }
- );
-
- RINTQual = ( { Ref integrity action/qualifier }
- rintRESTRICT, { Prohibit operation }
- rintCASCADE { Cascade operation }
- );
- {$ELSE}
- LKUPType = WordEnum; { Paradox Lookup type }
- const
- lkupNONE = 0; { Has no lookup }
- lkupPRIVATE = 1; { Just Current Field + Private }
- lkupALLCORRESP = 2; { All Corresponding + No Help }
- lkupHELP = 3; { Just Current Fld + Help and Fill }
- lkupALLCORRESPHELP = 4; { All Corresponging + Help }
-
- type
- RINTType = WordEnum; { Ref integrity type }
- const
- rintMASTER = 0; { This table is Master }
- rintDEPENDENT = 1; { This table is Dependent }
-
- type
- RINTQual = WordEnum; { Ref integrity action/qualifier }
- const
- rintRESTRICT = 0; { Prohibit operation }
- rintCASCADE = 1; { Cascade operation }
- {$ENDIF}
-
- const
- TODAYVAL = 2; { for Min/Max/Def val flags }
-
- { In VCHKDesc below, if any of bHasMinVal/bHasMaxVal/bHasDefVal }
- { = TODAYVAL, then TODAY is assumed. }
-
- type
- pVCHKDesc = ^VCHKDesc;
- VCHKDesc = packed record { Val Check structure }
- iFldNum : Word; { Field number }
- bRequired : WordBool; { If True, value is required }
- bHasMinVal : WordBool; { If True, has min value }
- bHasMaxVal : WordBool; { If True, has max value }
- bHasDefVal : WordBool; { If True, has default value }
- aMinVal : DBIVCHK; { Min Value }
- aMaxVal : DBIVCHK; { Max Value }
- aDefVal : DBIVCHK; { Default value }
- szPict : DBIPICT; { Picture string }
- elkupType : LKUPType; { Lookup/Fill type }
- szLkupTblName : DBIPATH; { Lookup Table name }
- end;
-
- pRINTDesc = ^RINTDesc;
- RINTDesc = packed record { Ref Integrity Desc }
- iRintNum : Word; { Ref integrity number }
- szRintName : DBINAME; { A name to tag this integegrity constraint }
- eType : RINTType; { Whether master/dependent }
- szTblName : DBIPATH; { Other table name }
- eModOp : RINTQual; { Modify qualifier }
- eDelOp : RINTQual; { Delete qualifier }
- iFldCount : Word; { Fields in foreign key }
- aiThisTabFld : DBIKEY; { Fields in this table }
- aiOthTabFld : DBIKEY; { Fields in other table }
- end;
-
-
- {============================================================================}
- { Security descriptor }
- {============================================================================}
- { Family rights }
-
- const
- NOFAMRIGHTS = $00; { No Family rights }
- FORMRIGHTS = $01; { Can change form }
- RPTRIGHTS = $02; { Can change reports }
- VALRIGHTS = $04; { Can change valchecks }
- SETRIGHTS = $08; { Can change settings }
- ALLFAMRIGHTS = (FORMRIGHTS or RPTRIGHTS or VALRIGHTS or SETRIGHTS);
- { All family rights }
-
- type
- PRVType = WordEnum;
- const
- prvNONE = 0; { No privilege }
- prvREADONLY = 1; { Read only Table or Field }
- prvMODIFY = 3; { Read and Modify fields (non-key) }
- prvINSERT = 7; { Insert + All of above }
- prvINSDEL = $0F; { Delete + All of above }
- prvFULL = $1F; { Full Writes }
- prvUNKNOWN = $FF; { Unknown }
-
-
- type
- pSECDesc = ^SECDesc;
- SECDesc = packed record { Security description }
- iSecNum : Word; { Nbr to identify desc }
- eprvTable : Word; { Table privileges }
- iFamRights : Word; { Family rights }
- szPassword : DBINAME; { Null terminated string }
- aprvFld : packed array [0..DBIMAXFLDSINSEC-1] of Word;
- { Field level privileges (prvNONE/prvREADONLY/prvFULL) }
- end;
-
- {============================================================================}
- { Miscellaneous }
- {============================================================================}
-
- { Index Id used to open table without a default index (i.e. no order) }
-
- const
- NODEFAULTINDEX = $FFFF;
-
-
- {============================================================================}
- { Object types }
- {============================================================================}
-
- type
- {$IFDEF VER80}
- DBIOBJType = (
- objFILLER, { Filler to make next start at 1 }
- objSYSTEM, { System object }
- objSESSION, { Session object }
- objDRIVER, { Driver object }
- objDATABASE, { Database object }
- objCURSOR, { Cursor object }
- objSTATEMENT, { Statement object }
- objCLIENT, { Client object }
- objDBSEC { DbSystem object (dBASE only) }
- );
- {$ELSE}
- DBIOBJType = WordEnum;
- const
- objSYSTEM = 1; { System object }
- objSESSION = 2; { Session object }
- objDRIVER = 3; { Driver object }
- objDATABASE = 4; { Database object }
- objCURSOR = 5; { Cursor object }
- objSTATEMENT = 6; { Statement object }
- objCLIENT = 7; { Client object }
- objDBSEC = 8; { DbSystem object (dBASE only) }
- {$ENDIF}
-
- {============================================================================}
- { Cursor properties }
- {============================================================================}
-
- type
- {$IFDEF VER80}
- DBIShareMode = ( { Database/Table Share type }
- dbiOPENSHARED, { Open shared (Default) }
- dbiOPENEXCL { Open exclusive }
- );
-
- DBIOpenMode = ( { Database/Table Access type }
- dbiREADWRITE, { Read + Write (Default) }
- dbiREADONLY { Read only }
- );
-
- DBILockType = ( { Lock types (Table level) }
- dbiNOLOCK, { No lock (Default) }
- dbiWRITELOCK, { Write lock }
- dbiREADLOCK { Read lock }
- );
-
- XLTMode = ( { Field translate mode }
- xltNONE, { No translation (Physical Types) }
- xltRECORD, { Record level translation (not supported) }
- xltFIELD { Field level translation (Logical types) }
- );
-
- UPDLockMode = ( { Update lock mode (SQL only) }
- updWHEREALL, { All fields in WHERE clause }
- updWHEREKEYCHG, { Key and changed fields in WHERE clause }
- updWHEREKEY { Key fields in WHERE clause }
- );
-
- {$ELSE}
- DBIShareMode = WordEnum; { Database/Table Share type }
- const
- dbiOPENSHARED = 0; { Open shared (Default) }
- dbiOPENEXCL = 1; { Open exclusive }
-
- type
- DBIOpenMode = WordEnum; { Database/Table Access type }
- const
- dbiREADWRITE = 0; { Read + Write (Default) }
- dbiREADONLY = 1; { Read only }
-
- type
- DBILockType = WordEnum; { Lock types (Table level) }
- const
- dbiNOLOCK = 0; { No lock (Default) }
- dbiWRITELOCK = 1; { Write lock }
- dbiREADLOCK = 2; { Read lock }
-
- type
- XLTMode = WordEnum; { Field translate mode }
- const
- xltNONE = 0; { No translation (Physical Types) }
- xltRECORD = 1; { Record level translation (not supported) }
- xltFIELD = 2; { Field level translation (Logical types) }
-
- type
- UPDLockMode = WordEnum; { Update lock mode (SQL only) }
- const
- updWHEREALL = 0; { All fields in WHERE clause }
- updWHEREKEYCHG= 1; { Key and changed fields in WHERE clause }
- updWHEREKEY = 2; { Key fields in WHERE clause }
-
- {$ENDIF}
-
- { Table Levels }
-
- const
- TBLLEVEL3 = 3; { Paradox level 3 and dBASE level 3+ }
- TBLLEVEL4 = 4; { Paradox level 4 and dBASE level 4 }
- TBLLEVEL5 = 5; { Paradox level 5 and dBASE/Win }
- FOXLEVEL25 = 25; { Fox Table (Ver 2.5) }
-
-
-
- type
- pCURProps = ^CURProps;
- CURProps = packed record { Virtual Table properties }
- szName : DBITBLNAME; { table name (no extension, if it can be derived) }
- iFNameSize : Word; { Full file name size }
- szTableType : DBINAME; { Driver type }
- iFields : Word; { No of fields in Table }
- iRecSize : Word; { Record size (logical record) }
- iRecBufSize : Word; { Record size (physical record) }
- iKeySize : Word; { Key size }
- iIndexes : Word; { Number of indexes }
- iValChecks : Word; { Number of val checks }
- iRefIntChecks : Word; { Number of Ref Integrity constraints }
- iBookMarkSize : Word; { Bookmark size }
- bBookMarkStable : WordBool; { Stable book marks }
- eOpenMode : DBIOpenMode; { ReadOnly / RW }
- eShareMode : DBIShareMode; { Excl / Share }
- bIndexed : WordBool; { Index is in use }
- iSeqNums : Integer; { 1: Has Seqnums; 0: Has Record# }
- bSoftDeletes : WordBool; { Supports soft deletes }
- bDeletedOn : WordBool; { If above, deleted recs seen }
- iRefRange : Word; { Not used }
- exltMode : XLTMode; { Translate Mode }
- iRestrVersion : Word; { Restructure version number }
- bUniDirectional : WordBool; { Cursor is uni-directional }
- eprvRights : Word; { Table rights }
- iFmlRights : Word; { Family rights }
- iPasswords : Word; { Number of Aux passwords }
- iCodePage : Word; { Codepage (0 if unknown) }
- bProtected : WordBool; { Table is protected by password }
- iTblLevel : Word; { Driver dependent table level }
- szLangDriver : DBINAME; { Language driver name }
- bFieldMap : WordBool; { Field map active }
- iBlockSize : Word; { Physical file blocksize in K }
- bStrictRefInt : WordBool; { Strict referential integrity }
- iFilters : Word; { Number of filters }
- bTempTable : WordBool; { Table is a temporary table }
- iUnUsed : packed array [0..15] of Word;
- end;
-
- {============================================================================}
- { Record Properties }
- {============================================================================}
-
- type
- pRECProps = ^RECProps;
- RECProps = packed record { Record properties }
- iSeqNum : Longint; { When Seq# supported only }
- iPhyRecNum : Longint; { When Phy Rec#s supported only }
- bRecChanged : WordBool; { Not used }
- bSeqNumChanged : WordBool; { Not used }
- bDeleteFlag : WordBool; { When soft delete supported only }
- end;
-
-
- {============================================================================}
- { General properties DbiGetProp/DbiSetProp }
- {============================================================================}
-
-
- { Cursor properties }
- { General }
- const
- curMAXPROPS = $00050000; { ro UINT16 , Number of defined properties }
- curTABLENAME = $00050001; { ro pTBLNAME , Table name }
- curTABLETYPE = $00050002; { ro pDBINAME , Table type }
- curTABLELEVEL = $00050003; { ro UINT16 , Table level 1..n }
- curFILENAME = $00050004; { ro pPATH , Full filename }
- curXLTMODE = $00050005; { rw XLTMode , Translate mode }
- curSEQREADON = $00050006; { rw BOOL , Sequential read mode hint ON }
- curONEPASSON = $00050007; { rw BOOL , One pass mode hint ON }
- curUPDATETS = $00050008; { ro TIMESTAMP, Update timestamp }
- curSOFTDELETEON = $00050009; { rw BOOL , Softdelete ON }
- curLANGDRVNAME = $0005000A; { ro pCHAR , Symbolic language drv. name }
- curCURSORNAME = $0005000B; { ro pCHAR , name of the cursor }
- maxcurPROPS = 11; { keep in sync when adding cursor properties }
-
- { Paradox specific }
- curPDXMAXPROPS = $01050000; { ro UINT16 , Number of defined properties }
- maxcurPDXPROPS = 0;
-
- { DBase specific }
- curDBMAXPROPS = $02050000; { ro UINT16 , Number of defined properties }
- curINEXACTON = $02050001; { rw BOOL , InExact match ON }
- curSHAREMODE = $02050002; { rw DBIShareMode, Share mode }
- maxcurDBPROPS = 2;
-
- { Text Driver specific }
- curDELIMITALLFLDS = $03050000; { rw BOOL , Delimit all fields. }
- curUSESCHEMAFILE = $03050001; { rw BOOL , read schema from a file }
-
- { SQL Driver specific }
- curUPDLOCKMODE = $04050000; { rw UPDLockMode ,Update lock mode }
- curNATIVEHNDL = $04050001; { ro pBYTE ,Native cursor handle }
-
- { Driver properties }
- { General }
- drvMAXPROPS = $00030000; { ro UINT16 , Number of defined properties }
- drvDRIVERTYPE = $00030002; { ro pDBINAME , Driver type }
- drvDRIVERVERSION = $00030003; { ro UINT16 , Driver version }
- maxdrvPROPS = 2; { keep in sync when adding driver properties }
-
- { Database properties }
- { General }
- dbMAXPROPS = $00040000; { ro UINT16 , Number of defined properties }
- dbDATABASENAME = $00040001; { ro pDBINAME , Database name/alias }
- dbDATABASETYPE = $00040002; { ro pDBINAME , Database type }
- dbDEFAULTDRIVER = $00040003; { rw pDBINAME , Default Driver name }
- dbPARAMFMTQMARK = $00040004; { rw BOOL , Stmt param marker fmt = ? }
- dbUSESCHEMAFILE = $00040005; { rw BOOL , for text driver only. }
- maxdbPROPS = 10; { keep in sync when adding ANY db properties }
-
- { SQL Driver specific }
- dbASYNCSUPPORT = $04040000; { ro BOOL , Async. qry exec support }
- dbPROCEDURES = $04040001; { ro BOOL , Stored procedure support }
- dbDEFAULTTXNISO = $04040002; { ro eXILType , Default transaction iso level }
- dbNATIVEHNDL = $04040003; { ro pBYTE , Native connection handle }
- dbNATIVEPASSTHRUHNDL = $04040004; { ro pBYTE , Native passthru connection handle }
- dbSERVERVERSION = $04040005; { ro UINT16 , Major server version number }
-
- { Session properties }
- { General }
- sesMAXPROPS = $00020000; { ro UINT16 , Number of defined properties }
- sesSESSIONNAME = $00020001; { ro pDBINAME , Name of seesion }
- sesNETFILE = $00020002; { rw pCHAR , Full filename of netfile (MAXPATHLEN) }
- sesCFGMODE = $00020003; { rw CFGMode, Mode of configuration file. }
- sesDEFAULTDRIVER = $00020004; { rw pDBINAME, default driver name }
- sesGROUPNAME = $00020005; { rw pCHAR, Security - user group name (dBASE) }
- sesUSERNAME = $00020006; { rw pCHAR, User Name }
- sesUSERPASSWORD = $00020007; { rw pCHAR, User password }
- sesSECFILENAME = $00020008; { rw pCHAR, Location of dBASE Security file }
- maxsesPROPS = 8; { keep in sync when adding session properties }
-
-
- { System properties }
- { General }
- sysMAXPROPS = $00010000; { ro UINT16 , Number of defined properties }
- sysLOWMEMUSAGE = $00010001; { ro UINT16 , Low memory usage in (k) }
- maxsysPROPS = 1; { keep in sync when adding system properties }
-
-
- { Statement properties }
- { General }
- stmtMAXPROPS = $00060001; { ro UINT16 Number of defined properties }
- stmtPARAMETERCOUNT = $00060002; { ro UINT16 Count of parameters }
- stmtPARAMETERDESCS = $00060003; { ro aFLDDesc Array of parameters }
- stmtLANGDRVNAME = $00060004; { ro pCHAR Symbolic language drv. name }
- stmtUNIDIRECTIONAL = $00060010; { rw BOOL Cursor Unidirectional }
- stmtCURSORNAME = $00060011; { rw pCHAR Cursor name }
- stmtNEWCONNECT = $00060012; { rw BOOL Stmt on new connection }
- stmtNATIVEHNDL = $00060013; { ro pBYTE Native statement handle }
- stmtROWCOUNT = $00060014; { ro UINT32 Rows effected by a stmt }
- maxstmtPROPS = 19; { keep in sync when adding ANY stmt properties }
-
- { specific to QBE or local SQL }
- stmtANSTYPE = $00060020; { rw pBYTE Table Type of Answer set }
- stmtLIVENESS = $00060021; { rw LIVENESS Preference for canned/live answers }
- stmtQRYMODE = $00060022; { rw QryEvalMode Execute on server or local or either }
- stmtBLANKS = $00060023; { rw BOOL True if blanks to be regarded as zeros. }
- stmtDATEFORMAT = $00060024; { rw FMTDate Date format }
- stmtNUMBERFORMAT = $00060025; { rw FMTNumber Number format }
- stmtAUXTBLS = $00060026; { rw BOOL True if QBE to create CHANGED, etc. }
- stmtTBLVECTOR = $00060027; { ro UINT16 Vector of tables generated by query. }
- stmtALLPROPS = $00060028; { rw QueryLowProps }
- stmtALLPROPSSIZE = $00060029; { rw INT16 size of QueryLowProps }
- stmtANSNAME = $00060030; { rw pBYTE Answer Table Name. }
-
-
- {============================================================================}
- { Transactions }
- {============================================================================}
-
- { Transaction support }
-
- type
- {$IFDEF VER80}
- eXILType = ( { Transaction isolation levels }
- xilDIRTYREAD, { Uncommitted changes read }
- xilREADCOMMITTED, { Committed changes, no phantoms }
- xilREPEATABLEREAD { Full read repeatability }
- );
-
- eXEnd = ( { Transaction end control }
- xendCOMMIT, { Commit transaction }
- xendCOMMITKEEP, { Commit transaction, keep cursors }
- xendABORT { Rollback transaction }
- );
-
- eXState = ( { Transaction end control }
- xsINACTIVE, { Transaction inactive }
- xsACTIVE { Transaction active }
- );
- {$ELSE}
- eXILType = WordEnum; { Transaction isolation levels }
- const
- xilDIRTYREAD = 0; { Uncommitted changes read }
- xilREADCOMMITTED = 1; { Committed changes, no phantoms }
- xilREPEATABLEREAD = 2; { Full read repeatability }
-
- type
- eXEnd = WordEnum; { Transaction end control }
- const
- xendCOMMIT = 0; { Commit transaction }
- xendCOMMITKEEP = 1; { Commit transaction, keep cursors }
- xendABORT = 2; { Rollback transaction }
-
- type
- eXState = WordEnum; { Transaction end control }
- const
- xsINACTIVE = 0; { Transaction inactive }
- xsACTIVE = 1; { Transaction active }
- {$ENDIF}
-
- type
- pXInfo = ^XInfo;
- XInfo = packed record
- exState : eXState; { xsActive, xsInactive }
- eXIL : eXILType; { Xact isolation level }
- uNests : Word; { Xact children }
- end;
-
-
- {============================================================================}
- { BookMark compares }
- {============================================================================}
-
- type
- PCMPBkMkRslt = ^CMPBkMkRslt;
- CMPBkMkRslt = WordEnum;
- const
- CMPLess = -1; { Bkm1 < Bkm2 }
- CMPEql = 0; { BookMarks are exactly the same }
- CMPGtr = 1; { Bkm1 > Bkm2 }
- CMPKeyEql = 2; { Only Bkm1.key_val = Bkm2.key_val }
-
- {============================================================================}
- { Key searches }
- {============================================================================}
-
- type
- {$IFDEF VER80}
- DBISearchCond = ( { Search condition for keys }
- keySEARCHEQ, { = }
- keySEARCHGT, { > }
- keySEARCHGEQ { >= }
- );
- {$ELSE}
- DBISearchCond = WordEnum;
- const
- keySEARCHEQ = 0; { = }
- keySEARCHGT = 1; { > }
- keySEARCHGEQ = 2; { >= }
- {$ENDIF}
-
-
- {============================================================================}
- { Create/Restructure descriptor }
- {============================================================================}
-
- type
- pCROpType = ^CROpType;
- {$IFDEF VER80}
- CROpType = ( { Create/Restruct Operation type }
- crNOOP,
- crADD, { Add a new element. }
- crCOPY, { Copy an existing element. }
- crMODIFY, { Modify an element. }
- crDROP, { Removes an element. }
- crREDO, { Reconstruct an element. }
- crTABLE, { Not used }
- crGROUP, { Not used }
- crFAMILY, { Not used }
- crDONE, { Used internally }
- crDROPADD { Used internally }
- );
- {$ELSE}
- CROpType = WordEnum; { Create/Restruct Operation type }
- const
- crNOOP = 0;
- crADD = 1; { Add a new element. }
- crCOPY = 2; { Copy an existing element. }
- crMODIFY = 3; { Modify an element. }
- crDROP = 4; { Removes an element. }
- crREDO = 5; { Reconstruct an element. }
- crTABLE = 6; { Not used }
- crGROUP = 7; { Not used }
- crFAMILY = 8; { Not used }
- crDONE = 9; { Used internally }
- crDROPADD = 10; { Used internally }
- {$ENDIF}
-
- type
- pCRTblDesc = ^CRTblDesc;
- CRTblDesc = packed record { Create/Restruct Table descr }
- szTblName : DBITBLNAME; { TableName incl. optional path & ext }
- szTblType : DBINAME; { Driver type (optional) }
- szErrTblName : DBIPATH; { Error Table name (optional) }
- szUserName : DBINAME; { User name (if applicable) }
- szPassword : DBINAME; { Password (optional) }
- bProtected : WordBool; { Master password supplied in szPassword }
- bPack : WordBool; { Pack table (restructure only) }
- iFldCount : Word; { Number of field defs supplied }
- pecrFldOp : pCROpType; { Array of field ops }
- pfldDesc : pFLDDesc; { Array of field descriptors }
- iIdxCount : Word; { Number of index defs supplied }
- pecrIdxOp : pCROpType; { Array of index ops }
- pidxDesc : PIDXDesc; { Array of index descriptors }
- iSecRecCount : Word; { Number of security defs supplied }
- pecrSecOp : pCROpType; { Array of security ops }
- psecDesc : pSECDesc; { Array of security descriptors }
- iValChkCount : Word; { Number of val checks }
- pecrValChkOp : pCROpType; { Array of val check ops }
- pvchkDesc : pVCHKDesc; { Array of val check descs }
- iRintCount : Word; { Number of ref int specs }
- pecrRintOp : pCROpType; { Array of ref int ops }
- printDesc : pRINTDesc; { Array of ref int specs }
- iOptParams : Word; { Number of optional parameters }
- pfldOptParams : pFLDDesc; { Array of field descriptors }
- pOptData : Pointer; { Optional parameters }
- end;
-
- {============================================================================}
- { Batch }
- {============================================================================}
-
- type
- pBATTblDesc = ^BATTblDesc;
- BATTblDesc = packed record { Batch Table definition struct }
- hDb : hDBIDb; { Database }
- szTblName : DBIPATH; { Table name }
- szTblType : DBINAME; { Optional Driver type }
- szUserName : DBINAME; { Optional User name }
- szPassword : DBINAME; { Optional Pass word }
- end;
-
- {$IFDEF VER80}
- eBATMode = ( { Batch mode for DBIBatchMove }
- batchAPPEND,
- batchUPDATE,
- batchAPPENDUPDATE,
- batchSUBTRACT,
- batchCOPY
- );
- {$ELSE}
- eBATMode = WordEnum; { Batch mode for DBIBatchMove }
- const
- batchAPPEND = 0;
- batchUPDATE = 1;
- batchAPPENDUPDATE = 2;
- batchSUBTRACT = 3;
- batchCOPY = 4;
- {$ENDIF}
-
- type
- pSORTOrder = ^SORTOrder;
- SORTOrder = ( { Sort Order }
- sortASCEND, { ascending (default) }
- sortDESCEND { descending }
- );
-
- ppfSORTCompFn = ^pfSORTCompFn;
- pfSORTCompFn = function ( { pntr to client compare fn }
- var LdObj : Pointer; { Language driver, if needed }
- var Value1 : Pointer; { first value }
- var Value2 : Pointer; { second value }
- iLen : Integer { Length, if needed }
- ): Integer;
-
- { Returns: -1 if (Value 1 < Value 2), }
- { 0 if (Value 1 == Value 2), }
- { +1 if (Value 1 > Value 2) }
-
-
- {============================================================================}
- { Types/Structs for Capabilities }
- {============================================================================}
-
- type
- {$IFDEF VER80}
- DRVCat = ( { Driver Category }
- drvFILLER, { Filler to make next start at 1 }
- drvFILE, { File based (Paradox, xBASE) }
- drvOTHERSERVER, { Other kind of server (IMS ?) }
- drvSQLBASEDSERVER { SQL Based Server }
- );
-
- OPType = ( { Config info & Optional Parameters }
- opFILLER0, { Filler to make first one 3 }
- opFILLER1, { Filler to make first one 3 }
- opFILLER2, { Filler to make first one 3 }
- opDBCREATE,
- opDBOPEN,
- opTBLCREATE,
- opTBLOPEN
- );
- {$ELSE}
- DRVCat = WordEnum; { Driver Category }
- const
- drvFILE = 1; { File based (Paradox xBASE) }
- drvOTHERSERVER = 2; { Other kind of server (IMS ?) }
- drvSQLBASEDSERVER = 3; { SQL Based Server }
-
- type
- OPType = WordEnum; { Config info & Optional Parameters }
- const
- opDBCREATE = 3;
- opDBOPEN = 4;
- opTBLCREATE = 5;
- opTBLOPEN = 6;
- {$ENDIF}
-
- type
- pDRVType = ^DRVType;
- DRVType = packed record { Driver Description/Capabilities }
- szType : DBINAME; { Symbolic name to identify }
- szText : DBINAME; { Descriptive text }
- edrvCat : DRVCat; { Driver category }
- bTrueDb : WordBool; { Supports True Db concept }
- szDbType : DBINAME; { Db Type to be used }
- bMultiUser : WordBool; { Supports Multi-user access }
- bReadWrite : WordBool; { Read Write or Read-only }
- bTrans : WordBool; { Supports Transactions }
- bPassThruSQL : WordBool; { Supports Pass-thru SQL }
- bLogIn : WordBool; { Requires explicit login }
- bCreateDb : WordBool; { Can reate a Database }
- bDeleteDb : WordBool; { Can drop database }
- bCreateTable : WordBool; { Can create a Table }
- bDeleteTable : WordBool; { Can delete a Table }
- bMultiplePWs : WordBool; { Multiple passwords }
- iDriverVersion : Word; { Driver version 1..n }
- bSQLRowid : WordBool; { Supports SQL rowid }
- iUnUsed : packed array [0..14] of Word;
- end;
-
-
- pTBLType = ^TBLType;
- TBLType = packed record { Table Capabilities }
- iId : Word; { Id of Table Type }
- szName : DBINAME; { Symbolic name; eg "dBASE" }
- szText : DBINAME; { Descriptive text }
- szFormat : DBINAME; { Format; eg "HEAP" }
- bReadWrite : WordBool; { User can Read/Write }
- bCreate : WordBool; { Can create new tables }
- bRestructure : WordBool; { Can restructure this table }
- bValChecks : WordBool; { Val Checks can be specified }
- bSecurity : WordBool; { Can be protected }
- bRefIntegrity : WordBool; { Can participate in ref integrity }
- bPrimaryKey : WordBool; { Supports primary key concept }
- bIndexing : WordBool; { Can have other indexes }
- iFldTypes : Word; { Number of Phy Field types supported }
- iMaxRecSize : Word; { Max record size }
- iMaxFldsInTable : Word; { Max fields in a table }
- iMaxFldNameLen : Word; { Maximum field name length }
- iTblLevel : Word; { Driver dependent table level (version) }
- iUnUsed : packed array [0..15] of Word;
- end;
-
-
- pIDXType = ^IDXType;
- IDXType = packed record
- iId : Word; { Id of index type }
- szName : DBINAME; { Symbolic name }
- szText : DBINAME; { Descriptive text }
- szFormat : DBINAME; { Optional format(BTREE, HASH etc) }
- bComposite : WordBool; { If composite keys are supported }
- bPrimary : WordBool; { True, if primary index }
- bUnique : WordBool; { True, No duplicates supported }
- bKeyDescending : WordBool; { If whole key can be descending }
- bFldDescending : WordBool; { Field level descending }
- bMaintained : WordBool; { Supports maintained option }
- bSubset : WordBool; { If Subset expression supported }
- bKeyExpr : WordBool; { If Key can be expression }
- bCaseInsensitive : WordBool; { If Keyinsensitive indexes supported }
- iUnUsed : packed array [0..15] of Word;
- end;
-
- pFLDType = ^FLDType;
- FLDType = packed record
- iId : Word; { Id of Field Type }
- szName : DBINAME; { Symbolic name; eg "ALPHA" }
- szText : DBINAME; { Descriptive text }
- iPhyType : Word; { Physical/Native type }
- iXltType : Word; { Default xlated type }
- iXltSubType : Word; { Default xlated sub type }
- iMaxUnits1 : Word; { Max units allowed (1) }
- iMaxUnits2 : Word; { Max units allowed (2) }
- iPhySize : Word; { Physical size in bytes (per unit) }
- bRequired : WordBool; { Supports 'required' option }
- bDefaultVal : WordBool; { Supports user specified 'default' }
- bMinVal : WordBool; { Supports MIN Val constraint }
- bMaxVal : WordBool; { Supports MAX Val constraint }
- bRefIntegrity : WordBool; { Can participate in ref integrity }
- bOtherChecks : WordBool; { Supports other kinds of checks }
- bKeyed : WordBool; { The field type can be keyed }
- bMultiplePerTable : WordBool; { Table can have more than 1 of this type }
- iMinUnits1 : Word; { Min units required (1) }
- iMinUnits2 : Word; { Min units required (2) }
- bCreateable : WordBool; { Type can be created }
- iUnUsed : packed array [0..15] of Word;
- end;
-
- {$IFDEF VER80}
- PROPValid = ( { PROP Validity }
- epropINVALID, { Property is INVALID (not supported) }
- epropCANGET, { You can GET value of the property }
- epropCANSET { You can GET and SET value of the property }
- );
- {$ELSE}
- PROPValid = WordEnum; { PROP Validity }
- const
- epropINVALID = 0; { Property is INVALID (not supported) }
- epropCANGET = 1; { You can GET value of the property }
- epropCANSET = 2; { You can GET and SET value of the property }
- {$ENDIF}
-
- {============================================================================}
- { Call Backs }
- {============================================================================}
-
- type
- pCBType = ^CBType;
-
- {$IFDEF VER80}
- CBType = ( { Call back type }
- cbGENERAL, { General purpose }
- cbRESERVED1,
- cbRESERVED2,
- cbINPUTREQ, { Input requested }
- cbRESERVED4,
- cbRESERVED5,
- cbBATCHRESULT, { Batch processing rslts }
- cbRESERVED7,
- cbRESTRUCTURE, { Restructure }
- cbRESERVED9,
- cbRESERVED10,
- cbRESERVED11,
- cbRESERVED12,
- cbRESERVED13,
- cbRESERVED14,
- cbRESERVED15,
- cbRESERVED16,
- cbRESERVED17,
- cbTABLECHANGED, { Table changed notification }
- cbRESERVED19,
- cbRESERVED20,
- cbRESERVED21,
- cbRESERVED22,
- cbGENPROGRESS, { Generic Progress report. }
- cbDBASELOGIN, { dBASE Login }
- cbNBROFCBS { Number of cbs }
- );
-
- pCBRType = ^CBRType;
- CBRType = ( { Call-back return type }
- cbrUSEDEF, { Take default action }
- cbrCONTINUE, { Continue }
- cbrABORT, { Abort the operation }
- cbrCHKINPUT, { Input given }
- cbrYES, { Take requested action }
- cbrNO, { Do not take requested action }
- cbrPARTIALASSIST { Assist in completing the job }
- );
- {$ELSE}
- CBType = WordEnum; { Call back type }
- const
- cbGENREAL = 0; { General purpose }
- cbRESERVED1 = 1;
- cbRESERVED2 = 2;
- cbINPUTREQ = 3; { Input requested }
- cbRESERVED4 = 4;
- cbRESERVED5 = 5;
- cbBATCHRESULT = 6; { Batch processing rslts }
- cbRESERVED7 = 7;
- cbRESTRUCTURE = 8; { Restructure }
- cbRESERVED9 = 9;
- cbRESERVED10 = 10;
- cbRESERVED11 = 11;
- cbRESERVED12 = 12;
- cbRESERVED13 = 13;
- cbRESERVED14 = 14;
- cbRESERVED15 = 15;
- cbRESERVED16 = 16;
- cbRESERVED17 = 17;
- cbTABLECHANGED = 18; { Table changed notification }
- cbRESERVED19 = 19;
- cbRESERVED20 = 20;
- cbRESERVED21 = 21;
- cbRESERVED22 = 22;
- cbGENPROGRESS = 23; { Generic Progress report. }
- cbDBASELOGIN = 24; { dBASE Login }
- cbNBROFCBS = 25; { Number of cbs }
-
- type
- pCBRType = ^CBRType;
- CBRType = WordEnum; { Call-back return type }
- const
- cbrUSEDEF = 0; { Take default action }
- cbrCONTINUE = 1; { Continue }
- cbrABORT = 2; { Abort the operation }
- cbrCHKINPUT = 3; { Input given }
- cbrYES = 4; { Take requested action }
- cbrNO = 5; { Do not take requested action }
- cbrPARTIALASSIST= 6; { Assist in completing the job }
- {$ENDIF}
-
- type
- ppfDBICallBack = ^pfDBICallBack;
- pfDBICallBack = function ( { Call-back funtion pntr type }
- ecbType : CBType; { Callback type }
- iClientData : Longint; { Client callback data }
- var CbInfo : Pointer { Call back info/Client Input }
- ): CBRType;
-
- { Progress callback structure }
-
- pCBPROGRESSDesc = ^CBPROGRESSDesc;
- CBPROGRESSDesc = packed record
- iPercentDone : Integer; { Percentage done. }
- szMsg : DBIMSG; { Message to display }
- end;
-
- {$IFDEF VER80}
- RESTErrObjType = ( { type of restructure object (restructure callback) }
- restrNONE,
- restrNEWFLD,
- restrOLDFLD,
- restrNEWINDEX,
- restrOLDINDEX,
- restrNEWVCHK,
- restrOLDVCHK,
- restrNEWRINT,
- restrOLDRINT,
- restrNEWSEC,
- restrOLDSEC,
- restrNEWTABLE
- );
- {$ELSE}
- RESTErrObjType = WordEnum; { type of restructure object (restructure callback) }
- const
- restrNONE = 0;
- restrNEWFLD = 1;
- restrOLDFLD = 2;
- restrNEWINDEX = 3;
- restrOLDINDEX = 4;
- restrNEWVCHK = 5;
- restrOLDVCHK = 6;
- restrNEWRINT = 7;
- restrOLDRINT = 8;
- restrNEWSEC = 9;
- restrOLDSEC = 10;
- restrNEWTABLE = 11;
- {$ENDIF}
-
- type
- TuObjDesc = packed record
- case Integer of
- 1: (fldDesc: FLDDesc);
- 2: (idxDesc: IDXDesc);
- 3: (vchkDesc: VCHKDesc);
- 4: (rintDesc: RINTDesc);
- 5: (secDesc: SECDesc);
- end;
-
- RESTCbDesc = packed record { restructure callback info }
- iErrCode : DBIResult;
- iTblNum : Word;
- iObjNum : Word;
- eRestrObjType : RESTErrObjType;
- uObjDesc : TuObjDesc;
- end;
-
- CBEntry = packed record { Entries for input requested callback }
- szKeyWord : DBINAME;
- szHelp : DBIMSG;
- end;
-
-
- {$IFDEF VER80}
- CBInputId = ( { Id for input requested callback }
- cbiFILLER, { Filler to make next start at 1 }
- cbiMDXMISSING, { MDX file missing request }
- cbiPDXLOOKUP, { Lookup table missing }
- cbiPDXBLOB, { Blob file missing }
- cbiDBTMISSING { DBT file missing request }
- );
- {$ELSE}
- CBInputId = WordEnum; { Id for input requested callback }
- const
- cbiMDXMISSING = 1; { MDX file missing request }
- cbiPDXLOOKUP = 2; { Lookup table missing }
- cbiPDXBLOB = 3; { Blob file missing }
- cbiDBTMISSING = 4; { DBT file missing request }
- {$ENDIF}
-
- const
- MAXCBENTRIES = 4;
-
- type
- CBInputDesc = packed record { Input requested callback structure }
- eCbInputId : CBInputId; { Id for this input request }
- iCount : Integer; { Number of entries }
- iSelection : Integer; { Selection 1..n (In/Out) }
- bSave : WordBool; { Save this option (In/Out) }
- szMsg : DBIMSG; { Message to display }
- acbEntry : packed array [0..MAXCBENTRIES-1] of CBEntry; { Entries }
- end;
-
- CBLoginDesc = packed record { dBASE login callback structure }
- szUserName : DBINAME; { Login name of user }
- szGroupName : DBINAME; { Group to log in to }
- szUserPassword : DBINAME; { User password }
- end;
-
- pCBLoginDesc = ^CBLoginDesc;
-
- { cbSERVERCALL info }
-
- {$IFDEF VER80}
- CBSCType = ( { Server call type }
- cbscRETURN, { Return from a call }
- cbscSQL { SQL server call }
- );
- {$ELSE}
- CBSCType = WordEnum; { Server call type }
- const
- cbscRETURN = 0; { Return from a call }
- cbscSQL = 1; { SQL server call }
- {$ENDIF}
-
- const
- cbSERVERCALL = cbRESERVED21;
-
- {============================================================================}
- { Basic Query Types }
- {============================================================================}
-
- type
- {$IFDEF VER80}
- DBIQryLang = (
- qrylangUNKNOWN, { UNKNOWN (Error) }
- qrylangQBE, { QBE }
- qrylangSQL { SQL }
- );
- {$ELSE}
- DBIQryLang = WordEnum;
- const
- qrylangUNKNOWN = 0; { UNKNOWN (Error) }
- qrylangQBE = 1; { QBE }
- qrylangSQL = 2; { SQL }
- {$ENDIF}
-
- {============================================================================}
- { Statement parameter information }
- {============================================================================}
-
- type
- eINDValues = WordEnum;
- const
- indTRUNC = -2; { Value has been truncated }
- indNULL = -1; { Value is NULL }
- indVALUE = 1;
-
- const
- INDLEN = sizeof(Word);
-
- {$IFDEF VER80}
- type
- STMTParamType = (
- paramUNKNOWN, { UNKNOWN (Error) }
- paramIN, { Input parameter }
- paramOUT, { Output parameter }
- paramINOUT, { Input/Output parameter }
- paramRET { Procedure (or function) return }
- );
-
- STMTParamFormat = (
- paramfmtUNKNOWN, { UNKNOWN (Error) }
- paramfmtNUMBER, { Numbered parameter markers of the form ? or :n }
- paramfmtNAME { Named parameters markers of the form :name }
- );
- {$ELSE}
- type
- STMTParamType = WordEnum;
- const
- paramUNKNOWN = 0; { UNKNOWN (Error) }
- paramIN = 1; { Input parameter }
- paramOUT = 2; { Output parameter }
- paramINOUT = 3; { Input/Output parameter }
- paramRET = 4; { Procedure (or function) return }
-
- type
- STMTParamFormat = WordEnum;
- const
- paramfmtUNKNOWN = 0; { UNKNOWN (Error) }
- paramfmtNUMBER = 1; { Numbered parameter markers of the form ? or :n }
- paramfmtNAME = 2; { Named parameters markers of the form :name }
- {$ENDIF}
-
- {============================================================================}
- { Properties For DbiQPrepareExt }
- {============================================================================}
-
- const
- qprepNONE = 0; { like DbiQPrepare }
- qprepFORUPDATE = $1; { do extra work, anticipating UPDATE WHERE CURRENT }
-
-
- {============================================================================}
- { Date, Time, Number Formats }
- {============================================================================}
-
- type
- pFMTNumber = ^FMTNumber;
- FMTNumber = packed record { Date Format }
- cDecimalSeparator : Char; { Default "." }
- cThousandSeparator : Char; { Default "," }
- iDecimalDigits : Byte; { Default 2 }
- bLeadingZero : Boolean; { Default TRUE. }
- end;
-
- pFMTDate = ^FMTDate;
- FMTDate = packed record
- szDateSeparator : packed array [0..3] of Char; { Default "/" }
- iDateMode : Byte; { 0 = MDY (Def), 1 = DMY, 2 = YMD }
- bFourDigitYear : Boolean; { Write Year as 4 digits (FALSE) }
- bYearBiased : Boolean; { On input add 1900 to year (TRUE) }
- bMonthLeadingZero : Boolean; { Month with Leading Zero (TRUE) }
- bDayLeadingZero : Boolean; { Day with Leading Zero (TRUE) }
- end;
-
- pFMTTime = ^FMTTime;
- FMTTime = packed record
- cTimeSeparator : Char; { Default ":" }
- bTwelveHour : Boolean; { Represent as 12 Hour time (FALSE) }
- szAmString : packed array [0..5] of Char; { Default Null (Only for 12 Hr) }
- szPmString : packed array [0..5] of Char; { Default Null (Only for 12 Hr) }
- bSeconds : Boolean; { Show Seconds (TRUE) }
- bMilSeconds : Boolean; { Show Milli Seconds (FALSE) }
- end;
-
- pFMTBcd = ^FMTBcd;
- FMTBcd = packed record
- iPrecision : Byte; { 1..64 considered valid }
- iSignSpecialPlaces : Byte; { sign:1, special:1, places:6 }
- iFraction : packed array [0..31] of Byte; { bcd nibbles, 00..99 per byte, high nibble 1st }
- end;
-
-
- {============================================================================}
- { Error Info }
- {============================================================================}
-
- type
- pDBIErrInfo = ^DBIErrInfo;
- DBIErrInfo = packed record { Error info }
- iError : DBIResult; { Last error code returned }
- szErrCode : DBIMSG; { Error Code }
- szContext : packed array[1..4] of DBIMSG; { Context info }
- end;
-
- { Error contexts (To be used with DbiGetErrorContext) }
-
- const
- ecTOKEN = 1; { Token (For QBE) }
- ecTABLENAME = 3; { Table name }
- ecFIELDNAME = 4; { Field Name }
- ecIMAGEROW = 5; { Image Row (For QBE) }
- ecUSERNAME = 6; { eg, In lock conflicts, user involved }
- ecFILENAME = 7; { File Name }
- ecINDEXNAME = 8; { Index Name }
- ecDIRNAME = 9; { Directory Name }
- ecKEYNAME = 10; { Key Name }
- ecALIAS = 11; { Alias }
- ecDRIVENAME = 12; { Drive name ('c:') }
- ecNATIVECODE = 13; { Native error code }
- ecNATIVEMSG = 14; { Native error message }
- ecLINENUMBER = 15; { Line Number }
- ecCAPABILITY = 16; { Capability }
- ecINTERNALLIMIT = 17; { Internal limit }
-
- {============================================================================}
- { Schema info structures }
- {============================================================================}
- { Database descriptor }
- {============================================================================}
-
-
- { DbiOpenDbList }
- type
- pDBDesc = ^DBDesc;
- DBDesc = packed record { A given Database Description }
- szName : DBINAME; { Logical name (Or alias) }
- szText : DBINAME; { Descriptive text }
- szPhyName : DBIPATH; { Physical name/path }
- szDbType : DBINAME; { Database type }
- end;
-
-
- {============================================================================}
- { User info descriptor }
- {============================================================================}
-
-
- { DbiOpenUserList }
- type
- pUSERDesc = ^USERDesc;
- USERDesc = packed record { User description }
- szUserName : DBIUSERNAME;
- iNetSession : Word; { Net level session number }
- iProductClass : Word; { Product class of user }
- szSerialNum : packed array [0..21] of Char; { Serial number }
- end;
-
- {============================================================================}
- { Table descriptor }
- {============================================================================}
-
-
- { DbiOpenTableList }
- type
- pTBLBaseDesc = ^TBLBaseDesc;
- TBLBaseDesc = packed record { Table description (Base) }
- szName : DBITBLNAME; { Table name(No extension or Dir) }
- szFileName : DBITBLNAME; { File name }
- szExt : DBIEXT; { File extension }
- szType : DBINAME; { Driver type }
- dtDate : Date; { Date on the table }
- tmTime : Time; { Time on the table }
- iSize : Longint; { Size in bytes }
- bView : WordBool; { If this a view }
- end;
-
- pTBLExtDesc = ^TBLExtDesc;
- TBLExtDesc = packed record { Table description (Extended part) }
- szStruct : DBINAME; { Physical structure }
- iRestrVersion : Word; { Version # }
- iRecSize : Word; { Physical record size }
- iFields : Word; { Number of fields }
- iIndexes : Word; { Number Indexes }
- iValChecks : Word; { Number of field validity checks }
- iRintChecks : Word; { Number of ref. integrity checks }
- iRecords : Longint; { Number of records in table }
- bProtected : WordBool; { If the table is prot }
- bValidInfo : WordBool; { Info available for this table }
- end;
-
- pTBLFullDesc = ^TBLFullDesc;
- TBLFullDesc = packed record { Table description (Base + Ext) }
- tblBase : TBLBaseDesc; { Base description }
- tblExt : TBLExtDesc; { Extended description }
- end;
-
- {============================================================================}
- { File descriptor }
- {============================================================================}
-
-
- { DbiOpenFileList }
- type
- pFILEDesc = ^FILEDesc;
- FILEDesc = packed record { File description }
- szFileName : DBIPATH; { File name (No Dir or ext) }
- szExt : DBIEXT; { Extension }
- bDir : WordBool; { True, if directory }
- iSize : Longint; { File size in bytes }
- dtDate : Date; { Date on the file }
- tmTime : Time; { Time on the file }
- end;
-
- {======================================================================}
- { Stored Procedure and Stored Procedure Param descriptor }
- {======================================================================}
-
- type
- pSPDesc = ^SPDesc;
- SPDesc = packed record
- szName : DBISPNAME;
- dtDate : Date;
- tmTime : Time;
- end;
-
- pSPParamDesc = ^SPParamDesc;
- SPParamDesc = packed record
- uParamNum : Word;
- szName : DBINAME;
- eParamType : STMTParamType;
- uFldType : Word;
- uSubType : Word;
- iUnits1 : Integer;
- iUnits2 : Integer;
- uOffset : Word;
- uLen : Word;
- uNullOffset : Word;
- end;
-
- {============================================================================}
- { Configuration Info Descriptor }
- {============================================================================}
-
- {$IFDEF VER80}
- CFGMode = (
- cfgPersistent, { Persistent only }
- cfgSession, { Session relative only }
- cfgAll { All (union) }
- );
- {$ELSE}
- CFGMode = WordEnum;
- const
- cfgPersistent = 0; { Persistent only }
- cfgSession = 1; { Session relative only }
- cfgAll = 2; { All (union) }
- {$ENDIF}
-
-
- { DbiOpenCfgInfoList }
- type
- pCFGDesc = ^CFGDesc;
- CFGDesc = packed record { Config description }
- szNodeName : DBINAME; { Node name }
- szDescription : packed array [0..DBIMAXSCFLDLEN-1] of Char; { Node description }
- iDataType : Word; { Value type }
- szValue : packed array [0..DBIMAXSCFLDLEN-1] of Char; { Value }
- bHasSubnodes : WordBool; { True, if not leaf node }
- end;
-
-
- {============================================================================}
- { Family descriptor }
- {============================================================================}
-
- type
- pFMLType = ^FMLType;
- {$IFDEF VER80}
- FMLType = ( { Family member types }
- fmlUNKNOWN,
- fmlTABLE,
- fmlINDEX,
- fmlFORM,
- fmlREPORT,
- fmlVALCHECK,
- fmlSECINDEX,
- fmlSECINDEX2,
- fmlBLOBFILE
- );
- {$ELSE}
- FMLType = WordBool; { Family member types }
- const
- fmlUNKNOWN = 0;
- fmlTABLE = 1;
- fmlINDEX = 2;
- fmlFORM = 3;
- fmlREPORT = 4;
- fmlVALCHECK = 5;
- fmlSECINDEX = 6;
- fmlSECINDEX2 = 7;
- fmlBLOBFILE = 8;
- {$ENDIF}
-
- { DbiOpenFamilyList }
- type
- pFMLDesc = ^FMLDesc;
- FMLDesc = packed record { Family record structure }
- szName : DBINAME; { Member name (documentary) }
- iId : Word; { Id (if applicable) }
- eType : FMLType; { Member type }
- szFileName : DBIPATH; { File name of member }
- end;
-
-
- {============================================================================}
- { Language driver descriptor }
- {============================================================================}
-
-
- const
- DBIOEM_CP = 1; { (dos) }
- DBIANSI_CP = 2; { (win) }
- DBIOS2_CP = 3;
- (* UNIX etc. *)
- DBISUNOS_CP = 4;
- DBIVMS_CP = 5;
- DBIHPUX_CP = 6;
- DBIULTRIX_CP = 7;
- DBIAIX_CP = 8;
- DBIAUX_CP = 9;
- DBIXENIX_CP = 10;
- DBIMAC_CP = 11;
- DBINEXT_CP = 12;
-
- { DbiOpenLdList }
- type
- pLDDesc = ^LDDesc;
- LDDesc = packed record { Lang Driver description }
- szName : DBINAME; { Driver symbolic name }
- szDesc : DBINAME; { Description }
- iCodePage : Word;
- PrimaryCpPlatform : Word;
- AlternateCpPlatform : Word;
- end;
-
- {============================================================================}
- { Lock descriptor }
- {============================================================================}
-
- { Lock types in LOCKDesc: }
-
- const
- lckRECLOCK = 0; { Normal Record lock (Write) }
- lckRRECLOCK = 1; { Special Pdox Record lock (Read) }
- lckGROUPLOCK = 2; { Pdox Group lock }
- lckIMGAREA = 3; { Pdox Image area }
- lckTABLEREG = 4; { Table registration/Open (No lock) }
- lckTABLEREAD = 5; { Table Read lock }
- lckTABLEWRITE = 6; { Table Write lock }
- lckTABLEEXCL = 7; { Table Exclusive lock }
- lckUNKNOWN = 9; { Unknown lock }
-
- { DbiOpenLockList }
- type
- pLOCKDesc = ^LOCKDesc;
- LOCKDesc = packed record { Lock Description }
- iType : Word; { Lock type (0 for rec lock) }
- szUserName : DBIUSERNAME; { Lock owner }
- iNetSession : Word; { Net level Session number }
- iSession : Word; { Idapi session#, if our lock }
- iRecNum : Longint; { If a record lock }
- iInfo : Word; { Info for table locks }
- end;
-
- {============================================================================}
- { Filter description }
- {============================================================================}
-
- type
- pCANOp = ^CANOp;
- {$IFDEF VER80}
- CANOp = (
- canNOTDEFINED, { (*) }
- canISBLANK, { CANUnary; is operand blank. (*) }
- canNOTBLANK, { CANUnary; is operand not blank. (*) }
- canEQ, { CANBinary, CANCompare; equal. (*) }
- canNE, { CANBinary; NOT equal. (*) }
- canGT, { CANBinary; greater than. (*) }
- canLT, { CANBinary; less than. (*) }
- canGE, { CANBinary; greater or equal. (*) }
- canLE, { CANBinary; less or equal. (*) }
- canNOT, { CANUnary; NOT (*) }
- canAND, { CANBinary; AND (*) }
- canOR, { CANBinary; OR (*) }
- canTUPLE2, { CANUnary; Entire record is operand. }
- canFIELD2, { CANUnary; operand is field (*) }
- canCONST2, { CANUnary; operand is constant (*) }
- canMINUS, { CANUnary; minus. }
- canADD, { CANBinary; addition. }
- canSUB, { CANBinary; subtraction. }
- canMUL, { CANBinary; multiplication. }
- canDIV, { CANBinary; division. }
- canMOD, { CANBinary; modulo division. }
- canREM, { CANBinary; remainder of division. }
- canSUM, { CANBinary, accumulate sum of. }
- canCOUNT, { CANBinary, accumulate count of. }
- canMIN, { CANBinary, find minimum of. }
- canMAX, { CANBinary, find maximum of. }
- canAVG, { CANBinary, find average of. }
- canCONT, { CANBinary; provides a link between two }
- canUDF2, { CANBinary; invokes a User defined fn }
- canCONTINUE2, { CANUnary; Stops evaluating records }
- canLIKE { CANCompare, extended binary compare (*) }
- );
-
- NODEClass = ( { Node Class }
- nodeNULL, { Null node (*) }
- nodeUNARY, { Node is a unary (*) }
- nodeBINARY, { Node is a binary (*) }
- nodeCOMPARE, { Node is a compare (*) }
- nodeFIELD, { Node is a field (*) }
- nodeCONST, { Node is a constant (*) }
- nodeTUPLE, { Node is a record }
- nodeCONTINUE, { Node is a continue node (*) }
- nodeUDF { Node is a UDF node }
- );
- {$ELSE}
- CANOp = WordEnum;
- const
- canNOTDEFINED = 0; { (*) }
- canISBLANK = 1; { CANUnary; is operand blank. (*) }
- canNOTBLANK = 2; { CANUnary; is operand not blank. (*) }
- canEQ = 3; { CANBinary CANCompare; equal. (*) }
- canNE = 4; { CANBinary; NOT equal. (*) }
- canGT = 5; { CANBinary; greater than. (*) }
- canLT = 6; { CANBinary; less than. (*) }
- canGE = 7; { CANBinary; greater or equal. (*) }
- canLE = 8; { CANBinary; less or equal. (*) }
- canNOT = 9; { CANUnary; NOT (*) }
- canAND = 10; { CANBinary; AND (*) }
- canOR = 11; { CANBinary; OR (*) }
- canTUPLE2 = 12; { CANUnary; Entire record is operand. }
- canFIELD2 = 13; { CANUnary; operand is field (*) }
- canCONST2 = 14; { CANUnary; operand is constant (*) }
- canMINUS = 15; { CANUnary; minus. }
- canADD = 16; { CANBinary; addition. }
- canSUB = 17; { CANBinary; subtraction. }
- canMUL = 18; { CANBinary; multiplication. }
- canDIV = 19; { CANBinary; division. }
- canMOD = 20; { CANBinary; modulo division. }
- canREM = 21; { CANBinary; remainder of division. }
- canSUM = 22; { CANBinary accumulate sum of. }
- canCOUNT = 23; { CANBinary accumulate count of. }
- canMIN = 24; { CANBinary find minimum of. }
- canMAX = 25; { CANBinary find maximum of. }
- canAVG = 26; { CANBinary find average of. }
- canCONT = 27; { CANBinary; provides a link between two }
- canUDF2 = 28; { CANBinary; invokes a User defined fn }
- canCONTINUE2 = 29; { CANUnary; Stops evaluating records }
- canLIKE = 30; { CANCompare extended binary compare (*) }
-
- type
- NODEClass = WordEnum; { Node Class }
- const
- nodeNULL = 0; { Null node (*) }
- nodeUNARY = 1; { Node is a unary (*) }
- nodeBINARY = 2; { Node is a binary (*) }
- nodeCOMPARE = 3; { Node is a compare (*) }
- nodeFIELD = 4; { Node is a field (*) }
- nodeCONST = 5; { Node is a constant (*) }
- nodeTUPLE = 6; { Node is a record }
- nodeCONTINUE = 7; { Node is a continue node (*) }
- nodeUDF = 8; { Node is a UDF node }
- {$ENDIF}
-
- { NODE definitions including misc data structures }
- {-------------------------------------------------}
-
- type
- pCANHdr = ^CANHdr;
- CANHdr = packed record { Header part common to all (*) }
- nodeClass : NODEClass;
- canOp : CANOp;
- end;
-
- pCANUnary = ^CANUnary;
- CANUnary = packed record { Unary Node (*) }
- nodeClass : NODEClass;
- canOp : CANOp;
- iOperand1 : Word; { Byte offset of Operand node }
- end;
-
- pCANBinary = ^CANBinary;
- CANBinary = packed record { Binary Node (*) }
- nodeClass : NODEClass;
- canOp : CANOp;
- iOperand1 : Word; { Byte offset of Op1 }
- iOperand2 : Word; { Byte offset of Op2 }
- end;
-
- pCANField = ^CANField;
- CANField = packed record { Field }
- nodeClass : NODEClass;
- canOp : CANOp;
- iFieldNum : Word;
- iNameOffset : Word; { Name offset in Literal pool }
- end;
-
- pCANConst = ^CANConst;
- CANConst = packed record { Constant }
- nodeClass : NODEClass;
- canOp : CANOp;
- iType : Word; { Constant type. }
- iSize : Word; { Constant size. (in bytes) }
- iOffset : Word; { Offset in the literal pool. }
- end;
-
- pCANTuple = ^CANTuple;
- CANTuple = packed record { Tuple (record) }
- nodeClass : NODEClass;
- canOp : CANOp;
- iSize : Word; { Record size. (in bytes) }
- end;
-
- pCANContinue = ^CANContinue;
- CANContinue = packed record { Break Node (*) }
- nodeClass : NODEClass;
- canOp : CANOp;
- iContOperand : Word; { Continue if operand is true. }
- end;
-
- pCANCompare = ^CANCompare;
- CANCompare = packed record { Extended compare Node (text fields) (*) }
- nodeClass : NODEClass;
- canOp : CANOp; { canLIKE, canEQ }
- bCaseInsensitive : WordBool; { 3 val: UNKNOWN = "fastest", "native" }
- iPartialLen : Word; { Partial fieldlength (0 is full length) }
- iOperand1 : Word; { Byte offset of Op1 }
- iOperand2 : Word; { Byte offset of Op2 }
- end;
-
- {This is the node to be used to pass User defined functions }
- const
- iLangSQL = 0; { Common SQL dialect }
- iDbaseExpr = 2; { This is also the driver ID for dBASE }
-
- type
- pCANUdf = ^CANUdf;
- CANUdf = packed record { A user defined function }
- nodeClass : NODEClass;
- canOp : CANOp;
- iOffSzFuncName : Word; { Offset in literal pool to Function Name string(0 terminated) }
- iOperands : Word; { Byte offset of Operands (concatenated using canCONT) }
- iDrvDialect : Word; { Driver Dialect ID for UDF string supplied }
- iOffSzUDF : Word; { Offset in literal pool to UDF string (0 terminated) }
- end;
-
- pCANNode = ^CANNode;
- CANNode = packed record
- case Integer of
- 1: (canHdr : CANHdr);
- 2: (canUnary : CANUnary);
- 3: (canBinary : CANBinary);
- 4: (canField : CANField);
- 5: (canConst : CANConst);
- 6: (canTuple : CANTuple);
- 7: (canContinue : CANContinue);
- 8: (canCompare : CANCompare);
- end;
-
- { Linear exression tree}
- {----------------------}
-
- const
- CANEXPRVERSION = 2;
-
- type
- ppCANExpr = ^pCANExpr;
- pCANExpr = ^CANExpr;
- CANExpr = packed record { Expression Tree }
- iVer : Word; { Version tag of expression. }
- iTotalSize : Word; { Size of this structure }
- iNodes : Word; { Number of nodes }
- iNodeStart : Word; { Starting offet of Nodes in this }
- iLiteralStart : Word; { Starting offset of Literals in this }
- end;
-
-
- {pfGENFilter returns TRUE, FALSE or ABORT }
- const
- ABORT = -2;
-
- type
- pfGENFilter = function (
- ulClientData : Longint;
- pRecBuf : Pointer;
- iPhyRecNum : Longint
- ): Integer;
-
- pFILTERInfo = ^FILTERInfo;
- FILTERInfo = packed record
- iFilterId : Word; { Id for filter }
- hFilter : hDBIFilter; { Filter handle }
- iClientData : Longint; { Client supplied data }
- iPriority : Word; { 1..N with 1 being highest }
- bCanAbort : WordBool; { TRUE : pfFilter can return ABORT }
- pfFilter : pfGENFilter; { Client filter function }
- pCanExpr : Pointer; { Supplied expression }
- bActive : WordBool; { TRUE : filter is active }
- end;
-
- {----------------------------------------------------------------------------}
- { DBI Query related types }
- {----------------------------------------------------------------------------}
-
- const
- MAXQBEEXPRSIZE = 300; { size of one QBE expr }
-
- {----------------------------------------------------------------------------}
-
- type
- pDBIQryProp = ^DBIQryProp;
- DBIQryProp = packed record
- szQryName : DBINAME; { Name of query }
- eLang : DBIQryLang; { Language }
- iQryPrice : Integer; { Query price 1..100 (1 = cheap, 100 = expensive) }
- iNumTables : Integer; { Number of tables in join. 0 = unknown. }
- bHasAnswer : WordBool;
- bInsert : WordBool;
- bDelete : WordBool;
- bChange : WordBool;
- end;
-
- {----------------------------------------------------------------------------}
-
- const
- DBIQBE_ANSWERBIT = ($1); { Answer table bit flag }
- DBIQBE_INSERTEDBIT = ($2); { Inserted table bit flag }
- DBIQBE_DELETEDBIT = ($4); { Deleted table bit flag }
- DBIQBE_CHANGEDBIT = ($8); { Changed table bit flag }
- DBIQBE_ERRORINSBIT = ($10); { Error inserted table bit flag }
- DBIQBE_ERRORDELBIT = ($20); { Error deleted table bit flag }
- DBIQBE_ERRORCHGBIT = ($40); { Error changed table bit flag }
-
-
- { answer cursor properties: }
- bAnsHasLiveFields = $1;
- bAnsHasFilter = $2;
- bAnsHasFieldMap = $4;
- bAnsHasCalcField = $8;
- bAnsHasLiveBlob = $10;
-
- { answer field properties: }
- bIsAnsFieldLive = $1;
-
- {----------------------------------------------------------------------------}
-
- type
- {$IFDEF VER80}
- DBIQryType = (
- dbiqryDEFAULT,
- dbiqryDIRTY,
- dbiqryCLEAN,
- dbiqryRESTART
- );
- {$ELSE}
- DBIQryType = WordEnum;
- const
- dbiqryDEFAULT = 0;
- dbiqryDIRTY = 1;
- dbiqryCLEAN = 2;
- dbiqryRESTART = 3;
- {$ENDIF}
-
- {----------------------------------------------------------------------------}
-
- type
- pDBIQryProgress = ^DBIQryProgress;
- DBIQryProgress = packed record
- stepsInQry : Word; { Total steps in query. }
- stepsCompleted : Word; { Steps completed out of total (steps may be skipped). }
- totElemInStep : Longint; { Total elements in current step. }
- elemCompleted : Longint; { Elements completed in current step. }
- end;
-
- { values for client indicating live/canned preference about query execution }
-
- {$IFDEF VER80}
- QryEvalMode = (
- qryModeNone, { Reserved }
- qryModeLOCAL,
- qryModeSERVER,
- qryModeEITHER,
- qryModeNOWLOCAL { used only in call back, when failed on server }
- );
-
- LIVENESS = (
- wantDEFAULT, { Default , same as wantCANNED }
- wantLIVE, { Want live data even if extra effort (no guarantee) }
- wantCANNED, { Want canned data even if extra effort (guaranteed) }
- wantSPEED { Let query manager decide, find out afterwards }
- );
- {$ELSE}
- QryEvalMode = WordEnum;
- const
- qryModeNone = 0; { Reserved }
- qryModeLOCAL = 1;
- qryModeSERVER = 2;
- qryModeEITHER = 3;
- qryModeNOWLOCAL = 4; { used only in call back, when failed on server }
-
- type
- LIVENESS = WordEnum;
- const
- wantDEFAULT = 0; { Default , same as wantCANNED }
- wantLIVE = 1; { Want live data even if extra effort (no guarantee) }
- wantCANNED = 2; { Want canned data even if extra effort (guaranteed) }
- wantSPEED = 3; { Let query manager decide, find out afterwards }
- {$ENDIF}
-
- type
- pQueryLowProps = ^QueryLowProps;
- QueryLowProps = packed record
- length : Integer; { Length in bytes of this structure }
- blankzeroes : WordBool; { TRUE if blanks to be regarded as zeros }
- dateFormat : FMTDate; { Date format }
- numberFormat : FMTNumber; { Number format }
- bNeedAuxTbls : WordBool; { if FALSE, don't bother with DELETED/ERRDEL, etc. }
- qryMode : QryEvalMode; { qryModeSERVER, qryModeLOCAL or qryModeEITHER. }
- perQrySqlMode : WordBool;
- livenessDesired : LIVENESS;
- end;
-
- {============================================================================}
- { DBI symbols }
- {============================================================================}
-
- const
- DBIMOD_BEGIN = ($3F00);
-
- DBIMOD_QBE = (DBIMOD_BEGIN + 1);
- DBIMOD_SQLG = (DBIMOD_BEGIN + 2);
- DBIMOD_LEGO = (DBIMOD_BEGIN + 3);
- DBIMOD_LOCKMNGR = (DBIMOD_BEGIN + 4);
- DBIMOD_SQLDRIVER = (DBIMOD_BEGIN + 5);
- DBIMOD_OS = (DBIMOD_BEGIN + 6);
- DBIMOD_DBASEDRV = (DBIMOD_BEGIN + 7);
-
- DBIMOD_END = (DBIMOD_BEGIN + 8);
-
- {----------------------------------------------------------------------------}
-
- DBISYM_BEGIN = (DBIMOD_END + 1);
-
- DBISYM_TOKEN = (DBISYM_BEGIN + ecTOKEN);
- DBISYM_TABLENAME = (DBISYM_BEGIN + ecTABLENAME);
- DBISYM_FIELDNAME = (DBISYM_BEGIN + ecFIELDNAME);
- DBISYM_IMAGEROW = (DBISYM_BEGIN + ecIMAGEROW);
- DBISYM_USERNAME = (DBISYM_BEGIN + ecUSERNAME);
- DBISYM_FILENAME = (DBISYM_BEGIN + ecFILENAME);
- DBISYM_INDEXNAME = (DBISYM_BEGIN + ecINDEXNAME);
- DBISYM_DIRNAME = (DBISYM_BEGIN + ecDIRNAME);
- DBISYM_KEYNAME = (DBISYM_BEGIN + ecKEYNAME);
- DBISYM_ALIAS = (DBISYM_BEGIN + ecALIAS);
- DBISYM_DRIVENAME = (DBISYM_BEGIN + ecDRIVENAME);
- DBISYM_NATIVECODE = (DBISYM_BEGIN + ecNATIVECODE);
- DBISYM_NATIVEMSG = (DBISYM_BEGIN + ecNATIVEMSG);
- DBISYM_LINENUMBER = (DBISYM_BEGIN + ecLINENUMBER);
- DBISYM_CAPABILITY = (DBISYM_BEGIN + ecCAPABILITY);
- DBISYM_INTERNALLIMIT=(DBISYM_BEGIN + ecINTERNALLIMIT);
-
- DBISYM_BASEEND = (DBISYM_BEGIN + 100);
-
- {----------------------------------------------------------------------------}
-
- DBISYM_MISC = (DBISYM_BASEEND + 1);
-
- DBISYM_WORK = (DBISYM_MISC + 1);
- DBISYM_PRIV = (DBISYM_MISC + 2);
- DBISYM_COPY = (DBISYM_MISC + 3);
- DBISYM_APPEND = (DBISYM_MISC + 4);
-
- DBISYM_END = (DBIMOD_BEGIN + $3FFF);
-
-
- {============================================================================}
- { DBI Config symbols }
- {============================================================================}
-
- { Categories }
-
- szCFGSYSTEM = 'SYSTEM';
- szCFGDRIVER = 'DRIVERS';
- szCFGDATABASE = 'DATABASES';
-
- {----------------------------------------------------------------------------}
- { System Fields }
- {----------------------------------------------------------------------------}
-
- szCFGSYSVERSION = 'VERSION';
- szCFGSYSNETTYPE = 'NET TYPE';
- szCFGSYSNETDIR = 'NET DIR';
- szCFGSYSLOCALSHARE = 'LOCAL SHARE';
- szCFGSYSLANGDRV = 'LANGDRIVER';
- szCFGSYSLANGDRVDIR = 'LANGDRVDIR';
- szCFGSYSMINBUF = 'MINBUFSIZE';
- szCFGSYSMAXBUF = 'MAXBUFSIZE';
- szCFGSYSLOCKRETRY = 'LOCKRETRY';
- szCFGSYSFLAGS = 'SYSFLAGS';
- szCFGMAXFILEHANDLES = 'MAXFILEHANDLES';
- szCFGSQLQRYMODE = 'SQLQRYMODE';
- szCFGLOWMEMLIMIT = 'LOW MEMORY USAGE LIMIT'; { Use this instead of NOLOWMEMBUF }
- szCFGSYSODBCCFGIMPORT = 'AUTO ODBC';
- szCFGSYSDEFDRV = 'DEFAULT DRIVER';
-
- {----------------------------------------------------------------------------}
- { Driver Fields }
- {----------------------------------------------------------------------------}
-
- szCFGDRVVERSION = 'VERSION';
- szCFGDRVTYPE = 'TYPE';
- szCFGDRVDLL = 'DLL';
- szCFGDRVFLAGS = 'DRIVER FLAGS';
- szCFGDRVLANGDRIVER = 'LANGDRIVER';
- szCFGDRVFILLFACTOR = 'FILL FACTOR';
- szCFGDRVBLOCKSIZE = 'BLOCK SIZE';
- szCFGDRVLOCKPROTOCOL = 'LOCKPROTOCOL';
- szCFGDRVLEVEL = 'LEVEL';
- szCFGDRVVENDINIT = 'VENDOR INIT';
-
- {----------------------------------------------------------------------------}
- { Dbase Driver fields }
- {----------------------------------------------------------------------------}
-
- szCFGDRVMEMOBLOCKSIZE = 'MEMO FILE BLOCK SIZE';
- szCFGDRVMDXBLOCKSIZE = 'MDX BLOCK SIZE';
-
-
- {----------------------------------------------------------------------------}
- { Driver Nodes }
- {----------------------------------------------------------------------------}
-
- szCFGDRVINIT = 'INIT';
- szCFGDBCREATE = 'DB CREATE';
- szCFGDBOPEN = 'DB OPEN';
- szCFGTBLCREATE = 'TABLE CREATE';
- szCFGTBLOPEN = 'TABLE OPEN';
-
- {----------------------------------------------------------------------------}
- { Database Nodes }
- {----------------------------------------------------------------------------}
-
- szCFGDBINFO = 'DB INFO';
-
- {----------------------------------------------------------------------------}
- { Database fields }
- {----------------------------------------------------------------------------}
-
- szCFGDBTYPE = 'TYPE';
- szCFGDBPATH = 'PATH';
- szCFGDBDEFAULTDRIVER = 'DEFAULT DRIVER';
-
- {----------------------------------------------------------------------------}
- { Others }
- {----------------------------------------------------------------------------}
-
- szCFGINIT = 'INIT';
- szTYPE = 'TYPE';
- szCFGDBSTANDARD = 'STANDARD';
- szCFGTRUE = 'TRUE';
- szCFGFALSE = 'FALSE';
- szOPENMODE = 'OPEN MODE';
- szREADWRITE = 'READ/WRITE';
- szREADONLY = 'READ ONLY';
- szSHAREMODE = 'SHARE MODE';
- szEXCLUSIVE = 'EXCLUSIVE';
- szSHARED = 'SHARED';
- szUSERNAME = 'USER NAME';
- szSERVERNAME = 'SERVER NAME';
- szDATABASENAME = 'DATABASE NAME';
- szSCHEMASIZE = 'SCHEMA CACHE SIZE';
- szCFGSTRICTINTEGRITY = 'STRICTINTEGRTY';
- szSQLPASSMODE = 'SQLPASSTHRU MODE';
- szNOTSHARED = 'NOT SHARED';
- szSHAREDAUTOCOMMIT = 'SHARED AUTOCOMMIT';
- szSHAREDNOAUTOCOMMIT = 'SHARED NOAUTOCOMMIT';
- szSCHEMATIME = 'SCHEMA CACHE TIME';
- szMAXQUERYTIME = 'MAX QUERY TIME';
-
-
- {----------------------------------------------------------------------------}
- { SYSTEM DATE/TIME/NUMBER FORMATS }
- { SYSTEM nodes: }
- {----------------------------------------------------------------------------}
- szCFGFORMAT = 'FORMATS';
-
- {----------------------------------------------------------------------------}
- { Format nodes: }
- {----------------------------------------------------------------------------}
- szCFGDATE = 'DATE';
- szCFGTIME = 'TIME';
- szCFGNUMBER = 'NUMBER';
-
- {----------------------------------------------------------------------------}
- { DATE and/or TIME fields: }
- {----------------------------------------------------------------------------}
- szCFGSEPARATOR = 'SEPARATOR';
- szCFGMODE = 'MODE';
- szCFGFOURDIGITYEAR = 'FOURDIGITYEAR';
- szCFGYEARBIASED = 'YEARBIASED';
- szCFGLEADINGZEROM = 'LEADINGZEROM';
- szCFGLEADINGZEROD = 'LEADINGZEROD';
- szCFGTWELVEHOUR = 'TWELVEHOUR';
- szCFGAMSTRING = 'AMSTRING';
- szCFGPMSTRING = 'PMSTRING';
- szCFGSECONDS = 'SECONDS';
- szCFGMILSECONDS = 'MILSECONDS';
-
- {----------------------------------------------------------------------------}
- { Number fields: }
- {----------------------------------------------------------------------------}
- szCFGDECIMALSEPARATOR = 'DECIMALSEPARATOR';
- szCFGTHOUSANDSEPARATOR = 'THOUSANDSEPARATOR';
- szCFGDECIMALDIGITS = 'DECIMALDIGITS';
- szCFGLEADINGZERON = 'LEADINGZERON';
-
- { String resoure id's for each string listed above }
-
- DBICFG_BASE = $3A00;
-
- {----------------------------------------------------------------------------}
- { Categories }
- {----------------------------------------------------------------------------}
- iCFGSYSTEM = (DBICFG_BASE + 1);
- iCFGDRIVER = (DBICFG_BASE + 2);
- iCFGDATABASE = (DBICFG_BASE + 3);
-
- {----------------------------------------------------------------------------}
- { System Fields }
- {----------------------------------------------------------------------------}
- iCFGSYSVERSION = (DBICFG_BASE + 5);
- iCFGSYSNETTYPE = (DBICFG_BASE + 6);
- iCFGSYSNETDIR = (DBICFG_BASE + 7);
- iCFGSYSLOCALSHARE = (DBICFG_BASE + 8);
- iCFGSYSLANGDRV = (DBICFG_BASE + 9);
- iCFGSYSLANGDRVDIR = (DBICFG_BASE + 10);
- iCFGSYSMINBUF = (DBICFG_BASE + 11);
- iCFGSYSMAXBUF = (DBICFG_BASE + 12);
- iCFGSYSLOCKRETRY = (DBICFG_BASE + 13);
- iCFGSYSFLAGS = (DBICFG_BASE + 14);
- iCFGMAXFILEHANDLES = (DBICFG_BASE + 15);
- iCFGSQLQRYMODE = (DBICFG_BASE + 16);
- iCFGLOWMEMLIMIT = (DBICFG_BASE + 17);
- iCFGSYSODBCCFGIMPORT=(DBICFG_BASE + 18);
- iCFGSYSDEFDRV = (DBICFG_BASE + 19);
-
-
- {----------------------------------------------------------------------------}
- { Driver Fields }
- {----------------------------------------------------------------------------}
- iCFGDRVVERSION = (DBICFG_BASE + 20);
- iCFGDRVTYPE = (DBICFG_BASE + 21);
- iCFGDRVLANGDRIVER = (DBICFG_BASE + 22);
- iCFGDRVFILLFACTOR = (DBICFG_BASE + 23);
- iCFGDRVBLOCKSIZE = (DBICFG_BASE + 24);
- iCFGDRVLOCKPROTOCOL = (DBICFG_BASE + 25);
- iCFGDRVLEVEL = (DBICFG_BASE + 26);
- iCFGDRVFLAGS = (DBICFG_BASE + 27);
-
- {----------------------------------------------------------------------------}
- { Dbase Driver fields }
- {----------------------------------------------------------------------------}
- iCFGDRVMEMOBLOCKSIZE = (DBICFG_BASE + 30 );
- iCFGDRVMDXBLOCKSIZE = (DBICFG_BASE + 31 );
-
-
-
- {----------------------------------------------------------------------------}
- { Driver Nodes }
- {----------------------------------------------------------------------------}
- iCFGDRVINIT = (DBICFG_BASE + 40 );
- iCFGDBCREATE = (DBICFG_BASE + 41 );
- iCFGDBOPEN = (DBICFG_BASE + 42 );
- iCFGTBLCREATE = (DBICFG_BASE + 43 );
- iCFGTBLOPEN = (DBICFG_BASE + 44 );
-
- {----------------------------------------------------------------------------}
- { Database Nodes }
- {----------------------------------------------------------------------------}
- iCFGDBINFO = (DBICFG_BASE + 50 );
-
- {----------------------------------------------------------------------------}
- { Database fields }
- {----------------------------------------------------------------------------}
- iCFGDBTYPE = (DBICFG_BASE + 60);
- iCFGDBPATH = (DBICFG_BASE + 61);
- iCFGDBDEFAULTDRIVER= (DBICFG_BASE + 62);
-
- {----------------------------------------------------------------------------}
- { Others }
- {----------------------------------------------------------------------------}
- iCFGINIT = (DBICFG_BASE + 70);
- iTYPE = (DBICFG_BASE + 71);
- iCFGDBSTANDARD = (DBICFG_BASE + 72);
- iCFGTRUE = (DBICFG_BASE + 73);
- iCFGFALSE = (DBICFG_BASE + 74);
- iOPENMODE = (DBICFG_BASE + 75);
- iREADWRITE = (DBICFG_BASE + 76);
- iREADONLY = (DBICFG_BASE + 77);
- iSHAREMODE = (DBICFG_BASE + 78);
- iEXCLUSIVE = (DBICFG_BASE + 79);
- iSHARED = (DBICFG_BASE + 80);
- iUSERNAME = (DBICFG_BASE + 81);
- iSERVERNAME = (DBICFG_BASE + 82);
- iDATABASENAME = (DBICFG_BASE + 83);
- iSCHEMASIZE = (DBICFG_BASE + 84);
- iCFGSTRICTINTEGRITY = (DBICFG_BASE + 85);
-
- {----------------------------------------------------------------------------}
- { System node: }
- {----------------------------------------------------------------------------}
- iCFGFORMAT = (DBICFG_BASE + 130);
-
- {----------------------------------------------------------------------------}
- { Format nodes: }
- {----------------------------------------------------------------------------}
- iCFGDATE = (DBICFG_BASE + 131);
- iCFGTIME = (DBICFG_BASE + 132);
- iCFGNUMBER = (DBICFG_BASE + 133);
-
- {----------------------------------------------------------------------------}
- { DATE and/or TIME fields: }
- {----------------------------------------------------------------------------}
- iCFGSEPARATOR = (DBICFG_BASE + 140);
- iCFGMODE = (DBICFG_BASE + 141);
- iCFGFOURDIGITYEAR = (DBICFG_BASE + 142);
- iCFGYEARBIASED = (DBICFG_BASE + 143);
- iCFGLEADINGZEROM = (DBICFG_BASE + 144);
- iCFGLEADINGZEROD = (DBICFG_BASE + 145);
- iCFGTWELVEHOUR = (DBICFG_BASE + 146);
- iCFGAMSTRING = (DBICFG_BASE + 147);
- iCFGPMSTRING = (DBICFG_BASE + 148);
- iCFGSECONDS = (DBICFG_BASE + 149);
- iCFGMILSECONDS = (DBICFG_BASE + 150);
-
- {----------------------------------------------------------------------------}
- { Number fields: }
- {----------------------------------------------------------------------------}
- iCFGDECIMALSEPARATOR = (DBICFG_BASE + 160);
- iCFGTHOUSANDSEPARATOR = (DBICFG_BASE + 161);
- iCFGDECIMALDIGITS = (DBICFG_BASE + 162);
- iCFGLEADINGZERON = (DBICFG_BASE + 163);
-
- iCFGDEFLANGDRV = (DBICFG_BASE + 165);
- iCFGDBASEDEFLANGDRV = (DBICFG_BASE + 166);
-
- {----------------------------------------------------------------------------}
- { Formats }
- {----------------------------------------------------------------------------}
- iCFGDEFSEPARATOR = (DBICFG_BASE + 170);
- iCFGDEFMODE = (DBICFG_BASE + 171);
- iCFGDEFFOURDIGITYEAR = (DBICFG_BASE + 172);
- iCFGDEFYEARBIASED = (DBICFG_BASE + 173);
- iCFGDEFLEADINGZEROM = (DBICFG_BASE + 174);
- iCFGDEFLEADINGZEROD = (DBICFG_BASE + 175);
- iCFGDEFTWELVEHOUR = (DBICFG_BASE + 176);
- iCFGDEFAMSTRING = (DBICFG_BASE + 177);
- iCFGDEFPMSTRING = (DBICFG_BASE + 178);
- iCFGDEFSECONDS = (DBICFG_BASE + 179);
- iCFGDEFMILSECONDS = (DBICFG_BASE + 180);
- iCFGDEFDECIMALSEPARATOR = (DBICFG_BASE + 181);
- iCFGDEFTHOUSANDSEPARATOR = (DBICFG_BASE + 182);
- iCFGDEFLEADINGZERO = (DBICFG_BASE + 183);
-
- implementation
-
- end.
-