home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / w3_prog / vbdb3b.arj / VBDEM.ZIP / FORM1.FRM (.txt) next >
Encoding:
Visual Basic Form  |  1991-09-08  |  5.7 KB  |  160 lines

  1. Form1
  2. DBase Demo
  3. Form1,
  4. Label1
  5. Output
  6. Picture1
  7. Courier
  8. Command1
  9. &Create
  10. Command2
  11. &Read
  12. Command3
  13. &Quit
  14. Command1_Click
  15. result
  16. getaddr
  17. db3file
  18. fieldar
  19. fieldarr
  20. form2
  21. loadp
  22. picture1
  23. tempstr
  24. peekbyt*
  25. Command3_Clickn
  26. pokebyt 
  27. pokebytoff/
  28. peekbytoffL
  29. filedarr
  30.     CreateDbfb
  31. lresult
  32. Iresult
  33. filename
  34. nameadd
  35. Data|
  36.     fielddata
  37. CloseDbf
  38. gataddr
  39. RTim8
  40. WriteDbErrorW
  41. asciib
  42. length
  43.     indicator
  44. offset(
  45. start
  46. which
  47. precedes;
  48. PASCAL
  49. strings#
  50. databuff
  51. RecPointer
  52. actual
  53.     MoveBytes
  54.     AppendDbf
  55. declared
  56. Command2_Click
  57.     dbfrecord
  58. OpenDBf
  59. GetDBfRecord<
  60. WriteDbRec
  61. GetDataPointer1
  62. dbrec
  63. subroutine.
  64. defined
  65. @    GetRecord
  66. RecNum{
  67. @    GetDBInfo
  68. DateOfUpdate
  69. NumRecs
  70. pointer
  71. record
  72.     StrToLong"
  73. AStrToLongc
  74. StrToLongtrToLong
  75. aStrToLong
  76. StrToLongtring
  77. RecLen
  78.     NumFields
  79. GetDBRecord
  80. StrToInt
  81.     repointer
  82. OpenDB
  83. Command1_Click
  84.  db3file, recpointer, and databuff
  85.  are declared in global.bas
  86.  because they need to be accessed by other
  87.  functions
  88.  Field definition buffer at 16 bytes per field
  89.  Maximum of 16 fieldss
  90.  Each field name must be preceeded by length Bytee
  91.  because the DLL expects PASCAL stringss
  92.  Field names must be upper case for DBase compatabilityy
  93.  Second field is Type allowable types aree
  94.   C  Character
  95.   N  Numeric
  96.   L  Logical
  97.   M  Memo (not implemented))
  98.   D  Date
  99.  Must be length 8 and stored as 
  100. ymmddm
  101.  Third field is Length as a char
  102.  Fourth field is Decimals for numeric fields
  103.  Fifth field is optional and representss
  104.  an integer offset from the start
  105.  of the record beginning with 1e
  106.  CUSTOMER is a Char field of 20 bytes with
  107.  no decimals and offset of 1
  108. CUSTOMER
  109.  DATE is a Date field length 8
  110.  AMOUNT is a Numeric field length 16
  111.  defaults to no decimals
  112. AMOUNT
  113.  Insert length byte before filenamee
  114.  as DLL expects PASCAL string
  115.  "db3test.dbf" is 11 bytes long hencee
  116.  chr$(11)+"db3test.dbf"t
  117. db3test.dbf"
  118. Create Status: "s
  119.  Get record buffer address held in db3file
  120.  structure at offset 251
  121.  Subroutine defined in general..
  122.  recpointer is declared in Global.base
  123.  Append recordss
  124.  Uses MoveBytes from assembler DLL vbaddr.dlll
  125.  Each record is 44 bytes
  126.  012345678901234567890123456789012345678901234
  127. ALPHA                19910901-100            "
  128. BETA                 199109022000            "
  129. GAMMA                199109033000            "
  130.  Close file
  131. Close status: s
  132. Command3_Click
  133. Command2_Click
  134.  Read the database created by the create buttonn
  135.  The Chr$(12) is the legth of file name and is
  136.  required because the DLL expects PASCAL strings
  137. db3test.dbf"
  138.  Opens the file and gets the database info intoo
  139.  global variabless
  140.    DateOfUpdate String*8
  141.    NumRecs
  142.  Longt
  143.    Reclen
  144.  Integert
  145.    NumFields
  146.  Integer
  147.    RecPointer   Long pointer to DLL data bufferr
  148. Cannot open db3test.dbf"u
  149. Recordt
  150. Error"u
  151. GetRecord
  152.  Gets one record from an open DBase file
  153. GetDBInfo
  154.  Extract the file details to GLOBAL.BAS variabless
  155.  Requires DBase file structure of an open file
  156.  DO NOT call before OpenDBfu
  157. StrToLong
  158. StrToInt
  159. OpenDB
  160.