ZIP CODE Database This software product is copyrighted and all rights reserved by HELP Software. HELP Software warrants this software product for a period of 90 days. Warranty requests must include invoice number and the date of purchase. The user hereby agrees that regardless of the form of any claim, liability for any damages or loss incurred because of this product shall not exceed the registration fee or purchase price. Return the manual, disk, and any backup copies to HELP Software if you decide not to accept this agreement. _______________________________________________________________________ This ZIP Code database was put together for use in database applications. It includes the City, State, and ZIP code for over 46,000 locations. It can be used to automatically look up a city and state when a valid ZIP Code is entered and insert them into the proper fields in your database to increase the speed and accuracy of data entry. In some cases (usually in the outlying areas of larger cities) a city may have both a place name and an official United States Postal Service name. In these cases, the official name is used in the ZIP Code database. In future versions, both names may be included. If this is something that you need, please let me know. These files are current through March of 1992. If you would like the current file you will need to purchase the updated file. The ZIP Code file is updated annually (in March). Updates can be purchased for $18.00 each. See the ORDER.FRM file for more information on purchasing current files. Included are simple examples for using this database with dBase, FoxPro, Clipper, and Microsoft Access. There is also a stand alone program ZIP.EXE which can be used to examine the database and to look up ZIP Codes or city and state combinations. If you develop code for use with other database languages or if you develop a more sophisticated program that you would like to donate, please send it to me. I would be glad to pass it along to those who may have a need for the database, but lack the expertise to develop a program for themselves. You should have the following files: DEMO.DBF Required for DEMO.PRG and FOXDEMO.PRG DEMO.PRG Demo dBase program to demonstrate lookups FOXDEMO.PRG Demo FOXPRO program to demonstrate lookups ORDER.FRM Form to order updated ZIP Code Files README.TXT This File ZIPCODES.DBF ZIP code Database File in dBase format ZIP.EXE ZIP code lookup / view program The ZIP Code file is updated annually (in March). Updates can be purchased for $18.00 each. See the ORDER.FRM file for more information on purchasing updated files. _______________________________________________________________________ USING ZIP.EXE - The ZIP Code Lookup Program To use the ZIP Code lookup program type ZIP and press enter. The first time that you use ZIP an index will be created to speed up lookups. Building the index can take a significant amount of time and disk space. Building the index took about 4 minutes on my 25MHz 486 machine. Fortunately, this only has to be done once. Once the index is created you will see a view of ZIP Codes, cities, and states listed in ZIP Code order. If you want to change the order that the ZIP Codes are listed press F2 and you will be able to choose the order that you wish. The file can be viewed by ZIP Code, State, City, or State and City. If you wish to look up a ZIP code press F3. You will be prompted for the ZIP Code that you wish to find. Enter the ZIP Code and press enter. If the ZIP Code is a valid ZIP Code then you will see it immediately, if not then you will see the closest available ZIP CODE. If you wish to look up a City, State combination then press F4. You will be asked to enter a State and City. You can enter the State, City, or both and you will be placed at the appropriate place in the database. When you perform a lookup based on City and State, the order of the database will automatically be changed (if necessary) to the State and City order. If, for some reason, you wish to remove some of the records you can mark them for deletion by pressing the space bar when the cursor is highlighting the record. When you do you will see an asterisk to the far left of the record. If you make a mistake simply press the space bar again and the mark will be removed. Once you have marked the records that you want to delete press F6 and the records will be removed permanently. This process can take some time so please be patient. To quit ZIP press ESCape. _______________________________________________________________________ DBASE III, DBASE IV, CLIPPER, and FOXPRO DEMO PROGRAM To try the dBase demo program, first load dBase. At the dot prompt type DO DEMO. The first time that you run this program you will be asked if you want to create an index file. This index file is required to perform the lookups. Just press enter when you are asked this and then wait for a few minutes while the index is built. Next, a data entry screen will appear and you can enter a sample record or two. When you enter a valid ZIP Code, the city and state will be looked up and inserted into the city and state fields. This same program will compile using Clipper as well. The FOXPRO demo program (FOXDEMO.PRG) works identically to the dBase demo program. Follow the directions listed above. You will need to type DO FOXDEMO instead of DO DEMO. Microsoft ACCESS Example The following example explains how to set up an automatic lookup with Microsoft Access. I would have preferred to distribute the database already set up and ready to go, but the size of the resulting file made this impractical. After loading Microsoft Access select NEW DATABASE from the FILE MENU. Name the new database ZIPCODES.MDB and choose OK. Next select IMPORT from the FILE MENU. For the database type choose dBase III. Select ZIPCODES.DBF for the file to import and press the IMPORT button. It will take a few minutes to import the file. When the import is complete you should see a message telling you that the import was successful. Close the IMPORT window. Press the DESIGN button to change the design of the ZIPCODES table. Highlight the ZIPCODE Field by pressing the grayed area directly to the left of the ZIPCODE field. Press the KEY icon to make the ZIPCODE field the primary key. A picture of a key should appear next to the ZIPCODE field name. Select SAVE from the FILE MENU to save the changes you made and wait a few minutes for the index to be created. Now close the DESIGN window. Now press the NEW button to create a new table. Enter the following fields into this table: Field Name Data Type Field Size First Name Text 30 characters Last Name Text 30 characters Address Text 30 characters Zip Code Text 5 characters City Text 30 characters State Text 2 characters Phone Text 10 characters Select SAVE from the FILE MENU and name the table DATA ENTRY. When you are asked for a primary key just select NO. Close the NEW TABLE window. Select RELATIONSHIPS from the EDIT MENU. Make the ZIPCODES table the primary table and DATA ENTRY the related table. The type of the relationship should be set to many. In the SELECT MATCHING FIELDS combo box select ZIP CODE then press the ADD button then CLOSE the window. Next select QUERY from the Database window and select NEW to create a new query. Add both the DATA ENTRY table and the ZIPCODES table. Next double click on the following fields from the DATA ENTRY table to add them to the query grid: First Name Last Name Address Zip Code From the ZIPCODES table double click on the City and State fields. From the DATA ENTRY table double click on the Phone field. Save the query with the name LOOKUP QUERY and close the query window. Now press the FORM button from the DATABASE WINDOW and then press the NEW button to create a new form. Select LOOKUP QUERY as the query to build the FORM from then press the FORM WIZARDS button. Choose the SINGLE-COLUMN Wizard. When you are asked which fields you want to add to your form press the >> button to move all fields into the new form and then press the NEXT button. Next click on EMBOSSED and then NEXT. Now press the OPEN button to open the form. Save the form with the name LOOKUP FORM. Try adding a couple of records. When you get to the ZIP CODE field try punching in your own ZIP Code and let ACCESS look up the city and state for you. If you wish, you can prevent editing in the City and State fields and skip over them entirely by changing the ENABLED property of the City and State controls in the LOOKUP FORM to NO. If you have any comments, suggestions, or questions please contact me at: HELP Software PO BOX 1423 Raymore, MO 64083 (816) 331-5809 CompuServe 73720,2530