home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / paradox / pxtest.bas < prev    next >
BASIC Source File  |  1991-08-09  |  11KB  |  196 lines

  1. ' pxengine.gbl
  2. ' written by J.W.Jaster 1991
  3. Global Const MBOK = 1
  4. Global Const TRUE = 1
  5. Global Const FALSE = 0
  6. Global Const DBPATH = "g:\vb\"
  7.  
  8. Global rc As Integer
  9. Global aValue As String * 255
  10. Global aSize As Integer
  11. Global sValue As Integer
  12. Global lValue As Long
  13. Global dValue As Double
  14. Global nFlds As Integer
  15. Global tIndex As Integer
  16. Global fldname As String * 255
  17. Global returnFld As String * 255
  18. Global mm As Integer
  19. Global yy As Integer
  20. Global dd As Integer
  21. Global filespec As String
  22.  
  23.  
  24. Global Const PXDEFAULT = 0                   ' use internal default value
  25. Global Const MAXTABLEHANDLES = 64             ' maximum number of open
  26. Global Const DEFTABLEHANDLES = 5              ' default number of open
  27.                                         ' tables allowed at a time
  28. Global Const MAXRECORDHANDLES = 128           ' maximum number of record
  29.                                         ' buffers available
  30. Global Const DEFRECORDHANDLES = 10            ' default number of record
  31.                                         ' buffers available
  32. Global Const MAXLOCKHANDLES = 128             ' maximum number of lock
  33.                                         ' handles per table
  34. Global Const DEFLOCKHANDLES = 32              ' default number of lock
  35.                                         ' handles per table
  36. Global Const MAXFILEHANDLES = 255             ' maximum number of DOS file
  37.                                         ' handles to use
  38. Global Const MINFILEHANDLES = 2               ' minimum number of DOS file
  39.                                         ' handles to use
  40. Global Const DEFFILEHANDLES = 10              ' default number of DOS file
  41.                                         ' handles to use
  42. ' Swap buffer size
  43. Global Const MAXSWAPSIZE = 256                ' maximum buffer size allowed (k)
  44. Global Const MINSWAPSIZE = 8                  ' minimum buffer size allowed (k)
  45. Global Const DEFSWAPSIZE = 32                 ' default buffer size (k)
  46.  
  47. ' Network codes
  48. ' used in PXNetInit
  49. Global Const NOTONNET = 1             ' not on a net
  50. Global Const NOVELLNET = 2            ' Novell
  51. Global Const THREECOMNET = 3          ' 3Com
  52. Global Const THREEOPENNET = 4         ' 3Com 3+Open
  53. Global Const OTHERNET = 5             ' other: unknown DOS 3.1 compatible
  54. Global Const STARLANNET = 7           ' Starlan
  55. Global Const BANYANNET = 8            ' Banyan
  56. Global Const IBMPCNET = 9             ' IBM PC
  57. Global Const LOCALSHARE = 32          ' enables sharing on local drives with
  58.                                 ' any net type
  59.                                 ' (i.e. OTHERNET | LOCALSHARE)
  60. Global Const DEFUSERNAME = ""       ' use default username in PXNetInit()
  61. ' used in PXKeyAdd
  62. Global Const PRIMARY = 0       ' primary index (key)
  63. Global Const SECONDARY = 1     ' not maintained secondary index
  64. Global Const INCSECONDARY = 2  ' maintained secondary index
  65. ' used in PXSrchFld, PXSrchKey
  66. Global Const SEARCHFIRST = 0     ' search from beginning of table
  67. Global Const SEARCHNEXT = 1      ' search from next record in table
  68. Global Const CLOSESTRECORD = 2   ' (modifier) goto 'nearest' record if
  69.                           ' no match found (ordered fields only)
  70. ' Lock types
  71. ' used in PXNetFileLock, PXNetFileUnlock, PXNetTblLock, PXNetTblUnlock
  72. Global Const FL = 1                   ' full lock, no concurrency
  73. Global Const WL = 2                   ' write lock
  74. Global Const PWL = 3                  ' prevent write lock
  75. Global Const PFL = 4                  ' prevent full lock, full concurrency
  76. ' macros for checking blank values
  77. Global Const BLANKDATE = &H80000000
  78. Global Const BLANKLONG = &H80000000
  79. Global Const BLANKSHORT = &H8000
  80. ' successful Engine function operation returns
  81. Global Const PXSUCCESS = 0
  82. ' errorcodes from Engine functions
  83. ' initialization errors
  84. Global Const PXERR_NOTINITERR = 78            ' Engine not initialized
  85. Global Const PXERR_ALREADYINIT = 82           ' Engine already initialized
  86. Global Const PXERR_NOTLOGGEDIN = 98           ' Could not login on network
  87.                                         ' (to PARADOX.NET)
  88. Global Const PXERR_NONETINIT = 107            ' Engine not initialized
  89.                                         ' with PXNetInit
  90. Global Const PXERR_NETMULTIPLE = 15           ' multiple PARADOX.NET files
  91.  
  92. Global Const PXERR_CANTSHAREPDOXNET = 134      ' can't lock PARADOX.NET -- is
  93.                                         ' SHARE.EXE loaded?
  94. Global Const PXERR_WINDOWSREALMODE = 135       ' can't run Engine in Windows
  95.                                         ' real mode
  96. ' hardware related errors
  97. Global Const PXERR_DRIVENOTREADY = 1          ' Drive not ready
  98. Global Const PXERR_DISKWRITEPRO = 124         ' Disk is write protected
  99. Global Const PXERR_GENERALFAILURE = 126       ' General hardware error
  100. ' directory reg error codes
  101. Global Const PXERR_DIRNOTFOUND = 2            ' Directory not found
  102. Global Const PXERR_DIRBUSY = 10               ' Sharing violation
  103. Global Const PXERR_DIRLOCKED = 11             ' Sharing violation
  104. Global Const PXERR_DIRNOACCESS = 12           ' No access to directory
  105. Global Const PXERR_DIRNOTPRIVATE = 14         ' Single user, but directory is
  106.                                         ' shared
  107. ' file oriented errors
  108. Global Const PXERR_FILEBUSY = 3               ' File is busy
  109. Global Const PXERR_FILELOCKED = 4             ' File is locked
  110. Global Const PXERR_FILENOTFOUND = 5           ' Could not find file
  111. ' table oriented errors
  112. Global Const PXERR_TABLEBUSY = 118             ' Table is busy
  113. Global Const PXERR_TABLELOCKED = 119           ' Table is locked
  114. Global Const PXERR_TABLENOTFOUND = 120         ' Table was not found
  115. Global Const PXERR_TABLEOPEN = 83             ' Unable to perform operation
  116.                                         ' on open table
  117. Global Const PXERR_TABLEINDEXED = 94          ' Table is indexed
  118. Global Const PXERR_TABLENOTINDEXED = 95       ' Table is not indexed
  119. Global Const PXERR_TABLEEMPTY = 105            ' Operation on empty table
  120. Global Const PXERR_TABLEWRITEPRO = 22         ' Table is write protected
  121. Global Const PXERR_TABLECORRUPTED = 6         ' Table is corrupted
  122. Global Const PXERR_TABLEFULL = 128            ' Table is full
  123. Global Const PXERR_TABLESQL = 130             ' Table is SQL replica
  124. Global Const PXERR_INSUFRIGHTS = 21           ' Insufficient password rights
  125. ' index oriented errors
  126. Global Const PXERR_XCORRUPTED = 7             ' Primary index is corrupted
  127. Global Const PXERR_XOUTOFDATE = 8             ' Primary index is out of date
  128. Global Const PXERR_XSORTVERSION = 13          ' Sort for index different
  129.                                         ' from table
  130. Global Const PXERR_SXCORRUPTED = 122          ' Secondary index is corrupted
  131. Global Const PXERR_SXOUTOFDATE = 96           ' Secondary index is out of date
  132. Global Const PXERR_SXNOTFOUND = 121           ' Secondary index was not found
  133. Global Const PXERR_SXOPEN = 123               ' Secondary index is already open
  134. Global Const PXERR_SXCANTUPDATE = 136         ' Can't update table open on non-                                                                         'maintained secondary
  135. Global Const PXERR_RECTOOBIG = 125            ' Record too big for index
  136.                                                                         ' record oriented errors
  137. Global Const PXERR_RECDELETED = 50            ' Another user deleted record
  138. Global Const PXERR_RECLOCKED = 9              ' Record is locked
  139. Global Const PXERR_RECNOTFOUND = 89           ' Record was not found
  140. Global Const PXERR_KEYVIOL = 97               ' Key violation
  141. Global Const PXERR_ENDOFTABLE = 101            ' End of table
  142. Global Const PXERR_STARTOFTABLE = 102          ' Start of table
  143.                                                         ' errors specific for Windows Engine DLL
  144. Global Const PXERR_TOOMANYCLIENTS = 131
  145. Global Const PXERR_EXCEEDSCONFIGLIMITS = 132
  146. Global Const PXERR_CANTREMAPFILEHANDLE = 133
  147. ' resource errors
  148. Global Const PXERR_OUTOFMEM = 40              ' Not enough memory to
  149.                                         ' complete operation
  150. Global Const PXERR_OUTOFDISK = 41             ' Not enough disk space to
  151.                                         ' complete operation
  152. Global Const PXERR_OUTOFSTACK = 127           ' Not enough stack space to
  153.                                         ' complete operation
  154. Global Const PXERR_OUTOFSWAPBUF = 129         ' Not enough swap buffer space to
  155.                                         ' complete operation
  156. Global Const PXERR_OUTOFFILEHANDLES = 70      ' No more file handles available
  157. Global Const PXERR_OUTOFTABLEHANDLES = 72  ' No more table handles                                                                                      'available
  158. Global Const PXERR_OUTOFRECHANDLES = 103       ' No more record handles                                                                                 'available
  159. Global Const PXERR_OUTOFLOCKHANDLES = 111      ' Too many locks on table
  160. Global Const PXERR_NOMORETMPNAMES = 86        ' No more temporary names
  161.                                         ' available
  162. Global Const PXERR_TOOMANYPASSW = 115          ' Too many passwords specified
  163.                                                                 ' invalid parameters to functions
  164. Global Const PXERR_TYPEMISMATCH = 30           ' Data type mismatch
  165. Global Const PXERR_OUTOFRANGE = 31            ' Argument out of range
  166. Global Const PXERR_INVPARAMETER = 33          ' Invalid argument
  167. Global Const PXERR_INVDATE = 73               ' Invalid date given
  168. Global Const PXERR_INVFIELDHANDLE = 75        ' Invalid field handle
  169. Global Const PXERR_INVRECHANDLE = 104          ' Invalid record handle
  170. Global Const PXERR_INVTABLEHANDLE = 76        ' Invalid table handle
  171. Global Const PXERR_INVLOCKHANDLE = 110         ' Invalid lock handle
  172. Global Const PXERR_INVDIRNAME = 114            ' Invalid directory name
  173. Global Const PXERR_INVFILENAME = 108          ' Invalid file name
  174. Global Const PXERR_INVTABLENAME = 99          ' Invalid table name
  175. Global Const PXERR_INVFIELDNAME = 74          ' Invalid field name
  176. Global Const PXERR_INVLOCKCODE = 106           ' Invalid lock code
  177. Global Const PXERR_INVUNLOCK = 109             ' Invalid unlock
  178. Global Const PXERR_INVSORTORDER = 112          ' Invalid sort order table
  179. Global Const PXERR_INVPASSW = 116              ' Invalid password
  180. Global Const PXERR_INVNETTYPE = 113            ' Invalid net type (PXNetInit)
  181. Global Const PXERR_BUFTOOSMALL = 117           ' Buffer too small for result
  182. Global Const PXERR_STRUCTDIFFER = 81          ' Table structures are different
  183. Global Const PXERR_INVENGINESTATE = 79        ' Previous fatal error;
  184.                                         ' cannot proceed
  185. ' values for ShareMode argument to PXWinInit
  186. Global Const PXSINGLECLIENT = 0 ' allow no other client access to Engine DLL
  187. Global Const PXEXCLUSIVE = 1    ' open all tables with FULL LOCK
  188. Global Const PXSHARED = 2       ' open all tables with PREVENT FULL LOCK
  189. ' declarations of sort order tables, used in PXSetDefaults
  190. Global Const SortOrderAscii = "a"   ' ASCII sort order
  191. Global Const SortOrderIntl = "i"    ' international sort order
  192. Global Const SortOrderNorDan = "n"  ' Norwegian/Danish sort order
  193. Global Const SortOrderSwedFin = "s"  ' Swedish/Finnish sort order
  194.  
  195.  
  196.