Sams Teach Yourself Visual Basic 6 in 24 Hours

Sams Teach Yourself Visual Basic 6 in 24 Hours

By Greg Perry

Workshop

The quiz questions and exercises are provided for your further understanding. See Appendix B for the answers.

Quiz

  1. What is the difference between a file and a database?

  2. What is the difference between a record and a field?

  3. What is the difference between a table and a file?

  4. What happens if you open an existing file in Output mode?

  5. What happens when you write to a file in Append mode?

  6. Which files does the following statement close?

    Close
    
  7. True or false: Your form must contain a different Data control for every table in the database.

  8. What advantage does a bound text box provide for the programmer who wants to write an application that lets the user update a database field?

  9. A database field is a Yes/No Access data field that can only take one of two values. Which Visual Basic control would best serve to represent that field?

  10. What's the simplest way to create a form based on a database?

Exercises

  1. Write an application that stores the names of your five favorite friends, their ages, and their phone numbers in five records in a disk file. Use Write # to write each three-value record and Input # to read each record. Call the data-entry and file-writing procedures from one procedure and the file-reading and display procedure from another procedure.
  2. Write a database application that displays the Biblio.mdb's book title table's first three fields. Don't let the user update the fields; you must be careful what kind of controls you use to display the field data.
  3. Use the Data Form Wizard to generate a table based on the entire Biblio.mdb's book title table. Connect the generated form to a command button's Click() event on the main form so that the data form appears for the user when the user clicks the command button.

Share ThisShare This

Informit Network