home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / FERRAMEN / ZIP_CODE / README.TXT < prev    next >
Encoding:
Text File  |  1993-08-25  |  5.4 KB  |  145 lines

  1. This ZIP Code file was put together for use in database 
  2. applications.  It can be used to automatically look up a 
  3. city and state when a valid ZIP Code is entered and insert 
  4. them into the proper fields to increase both speed and 
  5. accuracy of data entry.
  6.  
  7. These files are current through March of 1992.  If you would 
  8. like the 1993 ZIP Code file (or the most current file) you 
  9. will need to purchase the updated files.  See the ORDER.FRM 
  10. file for more information.  
  11.  
  12. There are two examples included which explain how this sort 
  13. of a lookup might be accomplished.  The first example is a 
  14. simple program for use with dBase III and dBase IV.  It can 
  15. also be compiled using Clipper.
  16.  
  17. The second example gives instructions for setting up a similar 
  18. lookup using Microsoft Access.
  19.  
  20. You should have the following files:
  21.  
  22.  ZIPCODES.DBF        Zipcode Database File in dBase format
  23.  DEMO.PRG            Demo dBase program to demonstrate lookups
  24.  DEMO.DBF            Required for DEMO.PRG
  25.  README.TXT          This File
  26.  ORDER.FRM           Form to order updated ZIP Code Files
  27.  
  28. The ZIP Code file is updated annually.  Updates can be purchased 
  29. for $18.00 each.  See the ORDER.FRM file for more information on 
  30. purchasing updated files.
  31.  
  32.  
  33.  
  34. DBASE III or DBASE IV DEMO PROGRAM
  35.  
  36. To try the dBase demo program, first load dBase.  At the dot 
  37. prompt type do DEMO.  The first time that you run this program 
  38. you will be asked if you want to create an index file.  This 
  39. index file is required to perform the lookups.  Just press 
  40. enter when you are asked this and then wait for a few minutes 
  41. while the index is built.
  42.  
  43. Next, a data entry screen will appear and you can enter a 
  44. sample record or two.  When you enter a valid ZIP Code, the 
  45. city and state will be looked up and inserted into the city 
  46. and state fields.
  47.  
  48.  
  49.  
  50.  
  51. Microsoft ACCESS Example
  52.  
  53. The following example explains how to set up an automatic 
  54. lookup with Microsoft Access.  I would have preferred to 
  55. distribute the database already set up and ready to go, but 
  56. the size of the resulting file made this impractical.
  57.  
  58. After loading Microsoft Access select NEW DATABASE from the 
  59. FILE MENU.  Name the new database ZIPCODES.MDB and choose OK.
  60.  
  61. Next select IMPORT from the FILE MENU.  For the database type 
  62. choose dBase III.  Select ZIPCODES.DBF for the file to import 
  63. and press the IMPORT button.  It will take a few minutes to 
  64. import the file.  When the import is complete you should see 
  65. a message telling you that the import was successful. Close the 
  66. IMPORT window.
  67.  
  68. Press the DESIGN button to change the design of the ZIPCODES 
  69. table.  Highlight the ZIPCODE Field by pressing the grayed area 
  70. directly to the left of the ZIPCODE field.  Press the KEY icon 
  71. to make the ZIPCODE field the primary key.  A picture of a key 
  72. should appear next to the ZIPCODE field name. Select SAVE from 
  73. the FILE MENU to save the changes you made and wait a few minutes 
  74. for the index to be created.  Now close the DESIGN window.
  75.  
  76. Now press the NEW button to create a new table.  Enter the 
  77. following fields into this table:
  78.         
  79.         Field Name    Data Type      Field Size
  80.         
  81.         First Name      Text         30 characters
  82.         Last Name       Text         30 characters
  83.         Address         Text         30 characters
  84.         Zip Code        Text          5 characters
  85.         City            Text         30 characters
  86.         State           Text          2 characters
  87.         Phone           Text         10 characters
  88.  
  89. Select SAVE from the FILE MENU and name the table DATA ENTRY.  
  90. When you are asked for a primary key just select NO.  Close the 
  91. NEW TABLE window.
  92.  
  93. Select RELATIONSHIPS from the EDIT MENU.  Make the ZIPCODES 
  94. table the primary table and DATA ENTRY the related table.  The 
  95. type of the relationship should be set to many.
  96.  
  97. In the SELECT MATCHING FIELDS combo box select ZIP CODE then 
  98. press the ADD button then CLOSE the window.
  99.  
  100. Next select QUERY from the Database window and select NEW to 
  101. create a new query.  Add both the DATA ENTRY table and the 
  102. ZIPCODES table.  Next double click on the following fields 
  103. from the DATA ENTRY table to add them to the query grid:
  104.  
  105.         First Name
  106.         Last Name
  107.         Address
  108.         Zip Code
  109.  
  110. From the ZIPCODES table double click on the City and State 
  111. fields.
  112.  
  113. From the DATA ENTRY table double click on the Phone field.
  114.  
  115. Save the query with the name LOOKUP QUERY and close the query 
  116. window.
  117.  
  118. Now press the FORM button from the DATABASE WINDOW and then 
  119. press the NEW button to create a new form.  Select LOOKUP 
  120. QUERY as the query to build the FORM from then press the 
  121. FORM WIZARDS button.
  122.  
  123. Choose the SINGLE-COLUMN Wizard.  When you are asked which 
  124. fields you want to add to your form press the >> button to 
  125. move all fields into the new form and then press the NEXT 
  126. button.  Next click on EMBOSSED and then NEXT.
  127.  
  128. Now press the OPEN button to open the form.  Save the form 
  129. with the name LOOKUP FORM.
  130.  
  131. Try adding a couple of records.  When you get to the ZIP CODE 
  132. field try punching in your own ZIP Code and let ACCESS look up 
  133. the city and state for you.
  134.  
  135. If you wish, you can prevent editing in the City and State 
  136. fields and skip over them entirely by changing the ENABLED 
  137. property of the City and State controls in the LOOKUP FORM to NO.
  138.  
  139.  
  140. HELP Software
  141. PO BOX 1423
  142. Raymore, MO 64083
  143. (816) 331-5809
  144. CompuServe 73720,2530
  145.