Sams Teach Yourself Visual Basic 6 in 24 Hours
- Table of Contents
- Copyright
- About the Author
- Acknowledgments
- Introduction
- Who Should Read This Book
- What This Book Will Do for You
- Can This Book Really Teach Visual Basic in 24 Hours?
- What You Need
- Files on the Visual Basic Distribution CD-ROM
- Conventions Used in This Book
- Enough! Time Is Ticking!
- Part I: Introducing Visual Basic
- Hour 1. Visual Basic at Work
- Hour 2.Analyzing Visual Basic Programs
- Hour 3.Controls and Properties
- Hour 4.Examining Labels, Buttons, and Text Boxes
- Part II: Coding the Details
- Hour 5.Putting Code into Visual Basic
- Hour 6.Message and Input Boxes
- Hour 7.Making Decisions
- Hour 8.Visual Basic Looping
- Part III:Putting Code to Work
- Hour 9.Combining Code and Controls
- Hour 10.List Boxes and Data Lists
- Hour 11.Additional Controls
- Hour 12.Dialog Box Basics
- Part IV:Programming with Data
- Hour 13.Modular Programming
- Hour 14.Built-In Functions Save Time
- Hour 15.Visual Basic Database Basics
- Hour 16.Printing with Visual Basic
- Part V:Sprucing Up Programs
- Hour 17.Menus and Visual Basic
- Hour 18.The Graphic Image Controls
- Hour 19.Toolbars and More Graphics
- Hour 20.Writing Correct Applications
- Part VI:Advancing Visual Basic Applications
- Hour 21.Visual Basic and ActiveX
- Hour 22.Object Basics
- Hour 23.Distributing Your Applications
- Hour 24.Online Visual Basic
- Part VII:Appendixes
- Appendix A.Operator Precedence
- Appendix B.Answers
- Appendix C.Using the CD-ROM
Workshop
The quiz questions and exercises are provided for your further understanding. See Appendix B for the answers.
Quiz
-
What is the difference between a file and a database?
-
What is the difference between a record and a field?
-
What is the difference between a table and a file?
-
What happens if you open an existing file in Output mode?
-
What happens when you write to a file in Append mode?
-
Which files does the following statement close?
Close
-
True or false: Your form must contain a different Data control for every table in the database.
-
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?
-
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?
-
What's the simplest way to create a form based on a database?
Exercises
- 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.
- 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.
- 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.
Hour 16.Printing with Visual Basic | Next Section

Account Sign In
View your cart