'I am placing this code and documentation in the public 'domain in the hopes that others may find it useful. You are 'free to use, modify and distribute it as you see fit. This 'code is provided on an as-is basis; I have tested much of it 'but it is not guaranteed to be bug-free. If you find errors 'or have suggestions for improvement, you can send them to me 'if you'd like. 'Sharon F. Dooley 'January 2, 1992 'CompuServe ID 70740,2330 'PAL and PARADOX are trademarks of Borland. Visual Basic is 'a trademark of Microsoft. ' This file contains type definitions and global constants needed ' to map Paradox Engine parameters and datatypes into VB. These ' definitions are based on the pxengine.h file supplied with the engine. ' ' Type definitions: These allow you to define the arguments in the same ' fashion as the engine documentation. Type TABLEHANDLE ' table handle thandle As Integer End Type Type RECORDHANDLE ' record handle rhandle As Integer End Type Type FIELDHANDLE ' field number 1.. fhandle As Integer End Type Type LOCKHANDLE ' lock handle lhandle As Integer End Type Type RECORDNUMBER ' record number 1.. recnum As Long End Type Type DATEFIELD ' representation of date pdxdate As Long End Type ' Maximum and default values for dynamic configuration. ' The default values are used if not overwritten in PXSetDefaults (DOS) ' or in WIN.INI (Windows) Global Const PXDEFAULT& = 0 ' tables allowed at a time Global Const MAXTABLEHANDLES = 64 ' tables allowed at a time Global Const DEFTABLEHANDLES = 5 ' buffers available Global Const MAXRECORDHANDLES = 128 ' buffers available Global Const DEFRECORDHANDLES = 10 ' handles per table Global Const MAXLOCKHANDLES = 128 ' handles per table Global Const DEFLOCKHANDLES = 32 ' handles to use Global Const MAXFILEHANDLES = 255 ' handles to use Global Const MINFILEHANDLES = 2 ' handles to use Global Const DEFFILEHANDLES = 10 Global Const DEFSORTORDER = "-1" 'ASCII ' Swap buffer size Global Const MAXSWAPSIZE = 256 Global Const MINSWAPSIZE = 8 Global Const DEFSWAPSIZE = 32 ' Network codes ' used in PXNetInit Global Const NOTONNET = 1 ' not on a net Global Const NOVELLNET = 2 ' Novell Global Const THREECOMNET = 3 ' 3Com Global Const THREEOPENNET = 4 ' 3Com 3+Open Global Const OTHERNET = 5 ' other: unknown DOS 3.1 compatible Global Const STARLANNET = 7 ' Starlan Global Const BANYANNET = 8 ' Banyan Global Const IBMPCNET = 9 ' IBM PC Global Const LOCALSHARE = 32 ' enables sharing on local drives with ' any net type ' (i.e. OTHERNET | LOCALSHARE) Global Const DEFUSERNAME = 0 ' used in PXKeyAdd Global Const PRIMARY = 0 ' primary index (key) Global Const SECONDARY = 1 ' not maintained secondary index Global Const INCSECONDARY = 2 ' maintained secondary index ' used in PXSrchFld, PXSrchKey Global Const SEARCHFIRST = 0 ' search from beginning of table Global Const SEARCHNEXT = 1 ' search from next record in table Global Const CLOSESTRECORD = 2 ' (modifier) goto 'nearest' record if ' no match found (ordered fields only) ' Lock types ' used in PXNetFileLock, PXNetFileUnlock, PXNetTblLock, PXNetTblUnlock Global Const FL = 1 ' full lock, no concurrency Global Const WL = 2 ' write lock Global Const PWL = 3 ' prevent write lock Global Const PFL = 4 ' prevent full lock, full concurrency ' commonly used constants Global Const NULL& = 0 ' The VBPXBLANKDATE allows the VB programmer to have a 'blank' test ' which is analogous to the Paradox Engine Blank test. You should use ' this value in any date variables which are to be left blank; the ' VBPXPUTDATE routine will handle the conversion. Similarly, the ' VBPXGETDATE routine will put this value in your variable if the ' Paradox table has a blank date. Global Const VBPXBLANKDATE = -99999.9 ' length of a user name on the network Global Const UserNetNameLen = 8 'change this if your net has smaller or 'larger names ' max pdox field name length Global Const FldNameLen = 25 ' max pdox field type length Global Const FldTypeLen = 5 ' max table length (which is really max dos file name length) Global Const TblNameLen = 64 ' successful Engine function operation returns Global Const PXSUCCESS% = 0 ' values for ShareMode argument to PXWinInit Global Const PXSINGLECLIENT = 0 ' allow no other client access to Engine DLL Global Const PXEXCLUSIVE = 1 ' open all tables with FULL LOCK Global Const PXSHARED = 2 ' open all tables with PREVENT FULL LOCK ' declarations of sort order tables, used in PXSetDefaults Global Const SortOrderAscii = "a" ' ASCII sort order Global Const SortOrderIntl = "i" ' international sort order Global Const SortOrderNorDan = "n" ' Norwegian/Danish sort order Global Const SortOrderSwedFin = "s" ' Swedish/Finnish sort order ' errorcodes from Engine functions ' initialization errors Global Const PXERR_NOTINITERR = 78 ' Engine not initialized Global Const PXERR_ALREADYINIT = 82 ' Engine already initialized Global Const PXERR_NOTLOGGEDIN = 98 ' Could not login on network ' (to PARADOX.NET) Global Const PXERR_NONETINIT = 107 ' Engine not initialized ' with PXNetInit Global Const PXERR_NETMULTIPLE = 15 ' multiple PARADOX.NET files Global Const PXERR_CANTSHAREPDOXNET = 134 ' can't lock PARADOX.NET -- is ' SHARE.EXE loaded? Global Const PXERR_WINDOWSREALMODE = 135 ' can't run Engine in Windows ' real mode ' hardware related errors Global Const PXERR_DRIVENOTREADY = 1 ' Drive not ready Global Const PXERR_DISKWRITEPRO = 124 ' Disk is write protected Global Const PXERR_GENERALFAILURE = 126 ' General hardware error ' directory reg error codes Global Const PXERR_DIRNOTFOUND = 2 ' Directory not found Global Const PXERR_DIRBUSY = 10 ' Sharing violation Global Const PXERR_DIRLOCKED = 11 ' Sharing violation Global Const PXERR_DIRNOACCESS = 12 ' No access to directory Global Const PXERR_DIRNOTPRIVATE = 14 ' Single user, but directory is ' shared ' file oriented errors Global Const PXERR_FILEBUSY = 3 ' File is busy Global Const PXERR_FILELOCKED = 4 ' File is locked Global Const PXERR_FILENOTFOUND = 5 ' Could not find file ' table oriented errors Global Const PXERR_TABLEBUSY = 118 ' Table is busy Global Const PXERR_TABLELOCKED = 119 ' Table is locked Global Const PXERR_TABLENOTFOUND = 120 ' Table was not found Global Const PXERR_TABLEOPEN = 83 ' Unable to perform operation ' on open table Global Const PXERR_TABLEINDEXED = 94 ' Table is indexed Global Const PXERR_TABLENOTINDEXED = 95 ' Table is not indexed Global Const PXERR_TABLEEMPTY = 105 ' Operation on empty table Global Const PXERR_TABLEWRITEPRO = 22 ' Table is write protected Global Const PXERR_TABLECORRUPTED = 6 ' Table is corrupted Global Const PXERR_TABLEFULL = 128 ' Table is full Global Const PXERR_TABLESQL = 130 ' Table is SQL replica Global Const PXERR_INSUFRIGHTS = 21 ' Insufficient password rights ' index oriented errors Global Const PXERR_XCORRUPTED = 7 ' Primary index is corrupted Global Const PXERR_XOUTOFDATE = 8 ' Primary index is out of date Global Const PXERR_XSORTVERSION = 13 ' Sort for index different ' from table Global Const PXERR_SXCORRUPTED = 122 ' Secondary index is corrupted Global Const PXERR_SXOUTOFDATE = 96 ' Secondary index is out of date Global Const PXERR_SXNOTFOUND = 121 ' Secondary index was not found Global Const PXERR_SXOPEN = 123 ' Secondary index is already open Global Const PXERR_SXCANTUPDATE = 136 ' Can't update table open on non-maintained secondary Global Const PXERR_RECTOOBIG = 125 ' Record too big for index ' record oriented errors Global Const PXERR_RECDELETED = 50 ' Another user deleted record Global Const PXERR_RECLOCKED = 9 ' Record is locked Global Const PXERR_RECNOTFOUND = 89 ' Record was not found Global Const PXERR_KEYVIOL = 97 ' Key violation Global Const PXERR_ENDOFTABLE = 101 ' End of table Global Const PXERR_STARTOFTABLE = 102 ' Start of table ' errors specific for Windows Engine DLL Global Const PXERR_TOOMANYCLIENTS = 131 Global Const PXERR_EXCEEDSCONFIGLIMITS = 132 Global Const PXERR_CANTREMAPFILEHANDLE = 133 ' resource errors Global Const PXERR_OUTOFMEM = 40 ' Not enough memory to ' complete operation Global Const PXERR_OUTOFDISK = 41 ' Not enough disk space to ' complete operation Global Const PXERR_OUTOFSTACK = 127 ' Not enough stack space to ' complete operation Global Const PXERR_OUTOFSWAPBUF = 129 ' Not enough swap buffer space to ' complete operation Global Const PXERR_OUTOFFILEHANDLES = 70 ' No more file handles available Global Const PXERR_OUTOFTABLEHANDLES = 72 ' No more table handles available Global Const PXERR_OUTOFRECHANDLES = 103 ' No more record handles available Global Const PXERR_OUTOFLOCKHANDLES = 111 ' Too many locks on table Global Const PXERR_NOMORETMPNAMES = 86 ' No more temporary names ' available Global Const PXERR_TOOMANYPASSW = 115 ' Too many passwords specified ' invalid parameters to functions Global Const PXERR_TYPEMISMATCH = 30 ' Data type mismatch Global Const PXERR_OUTOFRANGE = 31 ' Argument out of range Global Const PXERR_INVPARAMETER = 33 ' Invalid argument Global Const PXERR_INVDATE = 73 ' Invalid date given Global Const PXERR_INVFIELDHANDLE = 75 ' Invalid field handle Global Const PXERR_INVRECHANDLE = 104 ' Invalid record handle Global Const PXERR_INVTABLEHANDLE = 76 ' Invalid table handle Global Const PXERR_INVLOCKHANDLE = 110 ' Invalid lock handle Global Const PXERR_INVDIRNAME = 114 ' Invalid directory name Global Const PXERR_INVFILENAME = 108 ' Invalid file name Global Const PXERR_INVTABLENAME = 99 ' Invalid table name Global Const PXERR_INVFIELDNAME = 74 ' Invalid field name Global Const PXERR_INVLOCKCODE = 106 ' Invalid lock code Global Const PXERR_INVUNLOCK = 109 ' Invalid unlock Global Const PXERR_INVSORTORDER = 112 ' Invalid sort order table Global Const PXERR_INVPASSW = 116 ' Invalid password Global Const PXERR_INVNETTYPE = 113 ' Invalid net type (PXNetInit) Global Const PXERR_BUFTOOSMALL = 117 ' Buffer too small for result Global Const PXERR_STRUCTDIFFER = 81 ' Table structures are different Global Const PXERR_INVENGINESTATE = 79 ' Previous fatal error; ' cannot proceed