home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_refer / vb_pxen / vbpxglob.txt < prev   
Text File  |  1992-01-03  |  12KB  |  299 lines

  1. 'I am placing this code and documentation in the public 
  2. 'domain in the hopes that others may find it useful. You are 
  3. 'free to use, modify and distribute it as you see fit. This 
  4. 'code is provided on an as-is basis; I have tested much of it 
  5. 'but it is not guaranteed to be bug-free. If you find errors 
  6. 'or have suggestions for improvement, you can send them to me 
  7. 'if you'd like. 
  8. 'Sharon F. Dooley
  9. 'January 2, 1992
  10. 'CompuServe ID 70740,2330
  11. 'PAL and PARADOX are trademarks of Borland.  Visual Basic is 
  12. 'a trademark of Microsoft.
  13.  
  14. '   This file contains type definitions and global constants needed
  15. '   to map Paradox Engine parameters and datatypes into VB.  These
  16. '   definitions are based on the pxengine.h file supplied with the engine.
  17. '
  18.  
  19. '   Type definitions:  These allow you to define the arguments in the same
  20. '   fashion as the engine documentation.
  21.  
  22. Type TABLEHANDLE       '    table handle
  23.      thandle As Integer
  24. End Type
  25. Type RECORDHANDLE       '    record handle
  26.      rhandle As Integer
  27. End Type
  28. Type FIELDHANDLE         '    field number 1..
  29.      fhandle As Integer
  30. End Type
  31. Type LOCKHANDLE         '    lock handle
  32.      lhandle As Integer
  33. End Type
  34. Type RECORDNUMBER       '     record number 1..
  35.       recnum As Long
  36. End Type
  37. Type DATEFIELD             '    representation of date
  38.     pdxdate As Long
  39. End Type
  40.  
  41. '   Maximum and default values for dynamic configuration.
  42. '   The default values are used if not overwritten in PXSetDefaults (DOS)
  43. '   or in WIN.INI (Windows)
  44.  
  45. Global Const PXDEFAULT& = 0
  46. '                                           tables allowed at a time
  47. Global Const MAXTABLEHANDLES = 64
  48. '                                           tables allowed at a time
  49. Global Const DEFTABLEHANDLES = 5
  50. '                                           buffers available
  51. Global Const MAXRECORDHANDLES = 128
  52. '                                           buffers available
  53. Global Const DEFRECORDHANDLES = 10
  54. '                                           handles per table
  55. Global Const MAXLOCKHANDLES = 128
  56. '                                           handles per table
  57. Global Const DEFLOCKHANDLES = 32
  58.  
  59. '                                           handles to use
  60. Global Const MAXFILEHANDLES = 255
  61. '                                           handles to use
  62. Global Const MINFILEHANDLES = 2
  63. '                                           handles to use
  64. Global Const DEFFILEHANDLES = 10
  65.  
  66.  
  67. Global Const DEFSORTORDER = "-1"     'ASCII
  68. '   Swap buffer size
  69. Global Const MAXSWAPSIZE = 256
  70. Global Const MINSWAPSIZE = 8
  71. Global Const DEFSWAPSIZE = 32
  72.  
  73.  
  74. '   Network codes
  75. '   used in PXNetInit
  76.  
  77. Global Const NOTONNET = 1             '   not on a net
  78. Global Const NOVELLNET = 2            '   Novell
  79. Global Const THREECOMNET = 3          '   3Com
  80. Global Const THREEOPENNET = 4         '   3Com 3+Open
  81. Global Const OTHERNET = 5             '   other: unknown DOS 3.1 compatible
  82. Global Const STARLANNET = 7           '   Starlan
  83. Global Const BANYANNET = 8            '   Banyan
  84. Global Const IBMPCNET = 9             '   IBM PC
  85.  
  86. Global Const LOCALSHARE = 32          '   enables sharing on local drives with
  87.               '   any net type
  88.               '   (i.e. OTHERNET | LOCALSHARE)
  89.  
  90. Global Const DEFUSERNAME = 0
  91.  
  92. '   used in PXKeyAdd
  93.  
  94. Global Const PRIMARY = 0       '   primary index (key)
  95. Global Const SECONDARY = 1     '   not maintained secondary index
  96. Global Const INCSECONDARY = 2  '   maintained secondary index
  97.  
  98.  
  99. '   used in PXSrchFld, PXSrchKey
  100.  
  101. Global Const SEARCHFIRST = 0     '   search from beginning of table
  102. Global Const SEARCHNEXT = 1     '   search from next record in table
  103. Global Const CLOSESTRECORD = 2   '   (modifier) goto 'nearest' record if
  104.          '   no match found (ordered fields only)
  105.  
  106. '   Lock types
  107. '   used in PXNetFileLock, PXNetFileUnlock, PXNetTblLock, PXNetTblUnlock
  108.  
  109. Global Const FL = 1                   '   full lock, no concurrency
  110. Global Const WL = 2                   '   write lock
  111. Global Const PWL = 3                  '   prevent write lock
  112. Global Const PFL = 4                  '   prevent full lock, full concurrency
  113.  
  114.  
  115. '   commonly used constants
  116.  
  117. Global Const NULL& = 0
  118.  
  119. ' The VBPXBLANKDATE allows the VB programmer to have a 'blank' test
  120. ' which is analogous to the Paradox Engine Blank test.  You should use
  121. ' this value in any date variables which are to be left blank; the
  122. ' VBPXPUTDATE routine will handle the conversion.  Similarly, the
  123. ' VBPXGETDATE routine will put this value in your variable if the
  124. ' Paradox table has a blank date.
  125. Global Const VBPXBLANKDATE = -99999.9
  126.  
  127. ' length of a user name on the network
  128. Global Const UserNetNameLen = 8  'change this if your net has smaller or
  129.                  'larger names
  130.  
  131. ' max pdox field name length
  132.  Global Const FldNameLen = 25
  133. ' max pdox field type length
  134.  Global Const FldTypeLen = 5
  135. ' max table length (which is really max dos file name length)
  136.  Global Const TblNameLen = 64
  137.  
  138. '   successful Engine function operation returns
  139. Global Const PXSUCCESS% = 0
  140.                        
  141.  
  142. '   values for ShareMode argument to PXWinInit
  143.  
  144. Global Const PXSINGLECLIENT = 0 '   allow no other client access to Engine DLL
  145. Global Const PXEXCLUSIVE = 1    '   open all tables with FULL LOCK
  146. Global Const PXSHARED = 2       '   open all tables with PREVENT FULL LOCK
  147.  
  148.  
  149.  
  150. '   declarations of sort order tables, used in PXSetDefaults
  151. Global Const SortOrderAscii = "a"    '   ASCII sort order
  152. Global Const SortOrderIntl = "i"     '   international sort order
  153. Global Const SortOrderNorDan = "n"   '   Norwegian/Danish sort order
  154. Global Const SortOrderSwedFin = "s"  '   Swedish/Finnish sort order
  155.  
  156. '   errorcodes from Engine functions
  157.  
  158.  
  159. '   initialization errors
  160.  
  161. Global Const PXERR_NOTINITERR = 78            '   Engine not initialized
  162. Global Const PXERR_ALREADYINIT = 82           '   Engine already initialized
  163. Global Const PXERR_NOTLOGGEDIN = 98           '   Could not login on network
  164.               '   (to PARADOX.NET)
  165. Global Const PXERR_NONETINIT = 107            '   Engine not initialized
  166.               '   with PXNetInit
  167. Global Const PXERR_NETMULTIPLE = 15           '   multiple PARADOX.NET files
  168.  
  169. Global Const PXERR_CANTSHAREPDOXNET = 134      '   can't lock PARADOX.NET -- is
  170.                '   SHARE.EXE loaded?
  171. Global Const PXERR_WINDOWSREALMODE = 135       '   can't run Engine in Windows
  172.                '   real mode
  173.  
  174. '   hardware related errors
  175.  
  176. Global Const PXERR_DRIVENOTREADY = 1          '   Drive not ready
  177. Global Const PXERR_DISKWRITEPRO = 124         '   Disk is write protected
  178. Global Const PXERR_GENERALFAILURE = 126       '   General hardware error
  179.  
  180.  
  181. '   directory reg error codes
  182.  
  183. Global Const PXERR_DIRNOTFOUND = 2            '   Directory not found
  184. Global Const PXERR_DIRBUSY = 10               '   Sharing violation
  185. Global Const PXERR_DIRLOCKED = 11             '   Sharing violation
  186. Global Const PXERR_DIRNOACCESS = 12           '   No access to directory
  187. Global Const PXERR_DIRNOTPRIVATE = 14         '   Single user, but directory is
  188.               '   shared
  189.  
  190. '   file oriented errors
  191.  
  192. Global Const PXERR_FILEBUSY = 3               '   File is busy
  193. Global Const PXERR_FILELOCKED = 4             '   File is locked
  194. Global Const PXERR_FILENOTFOUND = 5           '   Could not find file
  195.  
  196. '   table oriented errors
  197.  
  198. Global Const PXERR_TABLEBUSY = 118            '   Table is busy
  199. Global Const PXERR_TABLELOCKED = 119          '   Table is locked
  200. Global Const PXERR_TABLENOTFOUND = 120        '   Table was not found
  201. Global Const PXERR_TABLEOPEN = 83             '   Unable to perform operation
  202.               '   on open table
  203. Global Const PXERR_TABLEINDEXED = 94          '   Table is indexed
  204. Global Const PXERR_TABLENOTINDEXED = 95       '   Table is not indexed
  205. Global Const PXERR_TABLEEMPTY = 105           '   Operation on empty table
  206. Global Const PXERR_TABLEWRITEPRO = 22         '   Table is write protected
  207.  
  208. Global Const PXERR_TABLECORRUPTED = 6         '   Table is corrupted
  209. Global Const PXERR_TABLEFULL = 128            '   Table is full
  210. Global Const PXERR_TABLESQL = 130             '   Table is SQL replica
  211. Global Const PXERR_INSUFRIGHTS = 21           '   Insufficient password rights
  212.  
  213.  
  214. '   index oriented errors
  215.  
  216. Global Const PXERR_XCORRUPTED = 7             '   Primary index is corrupted
  217. Global Const PXERR_XOUTOFDATE = 8             '   Primary index is out of date
  218. Global Const PXERR_XSORTVERSION = 13          '   Sort for index different
  219.               '   from table
  220.  
  221. Global Const PXERR_SXCORRUPTED = 122          '   Secondary index is corrupted
  222. Global Const PXERR_SXOUTOFDATE = 96           '   Secondary index is out of date
  223. Global Const PXERR_SXNOTFOUND = 121           '   Secondary index was not found
  224. Global Const PXERR_SXOPEN = 123               '   Secondary index is already open
  225. Global Const PXERR_SXCANTUPDATE = 136         '   Can't update table open on non-maintained secondary
  226.  
  227. Global Const PXERR_RECTOOBIG = 125            '   Record too big for index
  228.  
  229. '   record oriented errors
  230.  
  231. Global Const PXERR_RECDELETED = 50            '   Another user deleted record
  232. Global Const PXERR_RECLOCKED = 9              '   Record is locked
  233. Global Const PXERR_RECNOTFOUND = 89           '   Record was not found
  234. Global Const PXERR_KEYVIOL = 97               '   Key violation
  235.  
  236. Global Const PXERR_ENDOFTABLE = 101           '   End of table
  237. Global Const PXERR_STARTOFTABLE = 102         '   Start of table
  238.  
  239.  
  240. '   errors specific for Windows Engine DLL
  241.  
  242. Global Const PXERR_TOOMANYCLIENTS = 131
  243. Global Const PXERR_EXCEEDSCONFIGLIMITS = 132
  244. Global Const PXERR_CANTREMAPFILEHANDLE = 133
  245.  
  246. '   resource errors
  247.  
  248. Global Const PXERR_OUTOFMEM = 40              '   Not enough memory to
  249.               '   complete operation
  250. Global Const PXERR_OUTOFDISK = 41             '   Not enough disk space to
  251.               '   complete operation
  252. Global Const PXERR_OUTOFSTACK = 127           '   Not enough stack space to
  253.               '   complete operation
  254. Global Const PXERR_OUTOFSWAPBUF = 129         '   Not enough swap buffer space to
  255.               '   complete operation
  256.  
  257. Global Const PXERR_OUTOFFILEHANDLES = 70       '   No more file handles available
  258. Global Const PXERR_OUTOFTABLEHANDLES = 72      '   No more table handles available
  259. Global Const PXERR_OUTOFRECHANDLES = 103       '   No more record handles available
  260. Global Const PXERR_OUTOFLOCKHANDLES = 111      '   Too many locks on table
  261.  
  262. Global Const PXERR_NOMORETMPNAMES = 86        '   No more temporary names
  263.               '   available
  264. Global Const PXERR_TOOMANYPASSW = 115         '   Too many passwords specified
  265.  
  266.  
  267. '   invalid parameters to functions
  268.  
  269. Global Const PXERR_TYPEMISMATCH = 30          '   Data type mismatch
  270. Global Const PXERR_OUTOFRANGE = 31            '   Argument out of range
  271. Global Const PXERR_INVPARAMETER = 33          '   Invalid argument
  272. Global Const PXERR_INVDATE = 73               '   Invalid date given
  273.  
  274. Global Const PXERR_INVFIELDHANDLE = 75        '   Invalid field handle
  275. Global Const PXERR_INVRECHANDLE = 104         '   Invalid record handle
  276. Global Const PXERR_INVTABLEHANDLE = 76        '   Invalid table handle
  277. Global Const PXERR_INVLOCKHANDLE = 110        '   Invalid lock handle
  278.  
  279.  
  280. Global Const PXERR_INVDIRNAME = 114           '   Invalid directory name
  281. Global Const PXERR_INVFILENAME = 108          '   Invalid file name
  282. Global Const PXERR_INVTABLENAME = 99          '   Invalid table name
  283. Global Const PXERR_INVFIELDNAME = 74          '   Invalid field name
  284.  
  285. Global Const PXERR_INVLOCKCODE = 106          '   Invalid lock code
  286. Global Const PXERR_INVUNLOCK = 109            '   Invalid unlock
  287. Global Const PXERR_INVSORTORDER = 112         '   Invalid sort order table
  288. Global Const PXERR_INVPASSW = 116             '   Invalid password
  289. Global Const PXERR_INVNETTYPE = 113           '   Invalid net type (PXNetInit)
  290. Global Const PXERR_BUFTOOSMALL = 117          '   Buffer too small for result
  291.  
  292. Global Const PXERR_STRUCTDIFFER = 81          '   Table structures are different
  293.  
  294. Global Const PXERR_INVENGINESTATE = 79        '   Previous fatal error;
  295.               '   cannot proceed
  296.  
  297.  
  298.  
  299.