home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / fox_adr / readme.txt < prev   
Text File  |  1993-08-26  |  4KB  |  78 lines

  1. This is a revised version of ADR.ZIP - a simple address book
  2. application written in VB 3.0. It is intended to show one or two
  3. techniques for accessing and maintaining FoxPro tables with Visual
  4. Basic.
  5.  
  6. To run it you need VB 3.0 professional edition. There is an .EXE
  7. included as well, which you can run if you have the VBRUN300.DLL and
  8. XBS110.DLL files on your system.
  9.  
  10. ***PLEASE NOTE*** It will only run if the files are placed in a
  11. directory called ADR on drive C. If you change this directory, you
  12. will need to amend the path in the MAIN procedure, and several times
  13. in the PACK procedure as well.
  14.  
  15. This version is a little more elaborate than the previous one. It also
  16. differs in that the tables are in FoxPro format rather than dBase.
  17.  
  18. I hope its use is self-explanatory. The "Action needed" checkbox is
  19. intended as a way of marking the addresses of people where you need to
  20. take some action, such as replying to a letter. You can set the
  21. application just to show people who have action outstanding with the
  22. "Show outstanding action only" checkbox.
  23.  
  24. This leads to some interesting interactions, as the application needs
  25. to cope with possibilities like the "Action" checkbox being unchecked
  26. when the "filter" is active and there are no more records with
  27. outstanding action.
  28.  
  29. If you downlaoded ADR.ZIP you will notice a major change of approach.
  30. The original had the fields on the form updated directly from a VB
  31. table object. This new one uses a dynaset instead. The penalty is that
  32. one can no longer use "Seek". The advantage is that you can easily
  33. restrict the visible records to a subset, which is not possible with
  34. table objects (the equivalent of a SET FILTER... in xbase).
  35.  
  36. Dynasets have no index property. Therefore, the order is achieved by
  37. including "Order by" in the SQL statement which creates the dynaset.
  38. One consequence of this is that the dynaset needs to be recreated
  39. whenever a record is added. Otherwise, the new record goes onto the
  40. end of the dynaset, out of the correct order.
  41.  
  42. VB 3.0 records have no record number - the RECNO() that is so useful
  43. in FoxPro is absent. Therefore, this application illustrates how a
  44. counter field can be maintained in an xbase table. When a record is
  45. added, a unique number is found by Using the MAX function in a SQL
  46. query to find the highest existing number, and adding one.
  47.  
  48. This number is valuable for recording and restoring the current
  49. record. It's also used in a simple implementation of a read-only
  50. browse. The "List" button brings up a scrolling grid containing
  51. records. Each row actually includes the record number, although this
  52. is not visible. Therefore, when the user clicks on a row with the
  53. mouse, and exits the "browse" with OK, the application can easily look
  54. up the correct record and display it on the form.
  55.  
  56. The main headache is that updating a grid is so slow in VB! Therefore,
  57. it is not refreshed automatically (when a filter is set, or a record
  58. is deleted or added). You need to choose the "Refresh" button to
  59. refresh the list when necessary.
  60.  
  61. Finally, I've improved the "Pack" function by using the SQL INSERT
  62. function. Still very slow - but faster than it was.
  63.  
  64. I hope some of you find one or two tips from this app. Equally, I'd be
  65. glad to hear of other, better ways of solving some of the problems
  66. which come up even in a simple app. like this. Please post any
  67. suggestions in the forum, or mail me on 100023,3154.
  68.  
  69. This app. is not thoroughly tested - be cautious if you put it to
  70. serious use!
  71.  
  72. All the best,.
  73.  
  74. Tim Anderson
  75.  
  76. 26 August 1993
  77.  
  78.