Next chapterContents


Using Visual Basic 6

About the Authors


About the Authors

Bob Reselman is a principal consultant with the Des Moines office of Cap Gemini, a worldwide consulting organization that helps businesses achieve transformation through technology. Bob enjoys hearing from other developers. He can be reached at [email protected].

Wayne Pruchniak has been a Human Factors Engineer with Gateway since 1995. He spends much of his time designing software and trying to make computers a bit less frustrating. After that, he can be found either listening to music, tuning his home theater, or modifying his car. He currently resides in Sioux City, Iowa, and can be reached at [email protected].

Richard A. Peasley is also a principal consultant at Cap Gemini, practicing in the Information Technology Solutions Architecture group. His interests include learning new technology, trying to read technical reference materials, and teaching. When Richard isn't working, he's involved with his family and church in Elk Point, South Dakota. He can be reached at [email protected].

Eric A. Smith is a senior consultant with Information Strategies, a Washington, D.C.-based Microsoft Solution Provider. He specializes in Visual Basic development, but is also experienced in Web and database programming. He is a frequent contributor to Visual Basic Programmer's Journal and speaks at industry conferences. He is also the creator of Ask the VB Pro, a Web site that provides how-to information on Visual Basic (http://www.inquiry.com/thevbpro). Eric can be reached at [email protected].

Dedication

I dedicate this book to my sister, Nancy, and the miracle of e-mail.

-Bob Reselman

I dedicate this book to my parents. Without you, I wouldn't be what I am today, and I never forget.

-Wayne Pruchniak

To my wife and best friend, Sonja Swanson, and our two daughters, Sara and Annie, for their support on the long weekends and late nights writing this book. They are my life.

-Richard A. Peasley

For Jodi.

-Eric A. Smith

Acknowledgements

I very much want acknowledge the patience, support and understanding of Angela Kozlowski, acquisitions editor extraordinaire. Without her continuing guidance and help, this would have been an impossible project to do. Also I want to acknowledge the continued perseverance of my wife, Dorothy Lifka, and my daughters, Alexandra and Genevieve, for allowing yet another book into their lives.

--Bob Reselman

I'd like to thank Bob Reselman for giving me the opportunity to help write this book. Also, thanks to Angela Kozlowski and Susan Dunn for their patience and advice. And thanks to everyone at Gateway for giving me the opportunity to work on many different things.

-Wayne Pruchniak

On the shoulders of giants and in the company of friends, the depth of our vision and strength extends. Bob, it is a privilege to work with you professionally and to know you as a friend. I would like to thank you for inviting me to the party, Wayne for joining the party, Angela Kozlowski for hosting the party and helping me work through a travesty of personal technical problems, and finally the editors and production staff for making the pieces whole. Without the great team at Que, books like these would not be possible. A commercial book is truly a collaborative work of art.

-Richard A. Peasley

Tell Us What You Think!

As the reader of this book, you are our most important critic and commentator. We value your opinion and want to know what we're doing right, what we could do better, what areas you'd like to see us publish in, and any other words of wisdom you're willing to pass our way.

As the Executive Editor for the Client/Server and Database team at Macmillan Computer Publishing, I welcome your comments. You can fax, e-mail, or write me directly to let me know what you did or didn't like about this book--as well as what we can do to make our books stronger.

Please note that I cannot help you with technical problems related to the topic of this book, and that due to the high volume of mail I receive, I might not be able to reply to every message.

When you write, please be sure to include this book's title and author as well as your name and phone or fax number. I will carefully review your comments and share them with the author and editors who worked on the book.

Fax: 317-817-7070
E-mail: [email protected]
Mail: Executive Editor
Client/Server and Database Team
Macmillan Computer Publishing
201 West 103rd Street
Indianapolis, IN 46290 USA

Introduction

THIS BOOK IS NOT ONLY FOR beginning programmers who want to learn Visual Basic but also experienced programmers who are familiar with other programming languages and seek a working knowledge of Visual Basic. Every page of Using Visual Basic 6 provides you with useful facts and techniques. The aim is to teach you how to program by showing you programs--sometimes step by step and sometimes with a conceptual, from-the-ground-up point of view.

The author of this book assumes that you have a working knowledge of Windows, that you've done word processing or used a spreadsheet, and that you know your way around the Windows interface. It's also assumed that you have a copy of Visual Basic 6, access to a computer, and time to review the topics and work with the examples in each chapter. Very, very rarely can someone read a book on computer programming and instantly "get it" without taking the time for some hands-on experience.

Learning a programming language is a challenging experience. The author and technical reviewers of this book are professional programmers who have made every effort to convey the fun and challenge of VB programming while addressing your need for relevant, easy-to-understand material. If Visual Basic programming is something that you want to do, either professionally or as a side activity, and you need a book that instructs in a clear, concise, real-world manner, this is for you.

Why This Book?

Have you ever purchased a Using book from Que? For many years, the Using books have proven invaluable to readers as both learning guides and references. The Using series is an industry leader and has become practically an industry standard. We encourage and receive feedback from readers all the time, using their suggestions whenever possible.

This book isn't a compiled authority on all the features of Visual Basic. It's a streamlined, conversational approach to productive, efficient programming in Visual Basic. Features of this book include

How to Use This Book

You can use this book in various ways:

Each page of the book contains the main text and margin notes. These margin notes are helpful when you're looking for brief snippets of information. The book is also full of figures, code listings, and tables that you will find useful now and in months to come as you refer to this book in your day-to-day programming activity.

More than 20 working programs are associated with this book. You can download these from the book's Web site at http://www.mcp.com/info. When you locate the URL, you'll be asked to enter the book's ISBN: Enter 078971633x and then click the Search button to go to the Book Info page. You'll find references and listings that relate to the code throughout the book. Feel free to use the code in your own programming activities.

How This Book Is Organized

The book is organized into five parts. The first three parts give you a fundamental knowledge of the Visual Basic programming language and the Visual Basic programming environment; the last two parts cover advanced Visual Basic topics such as object-oriented programming, ActiveX control creation, Internet programming, data access, and databases.

Part I: Visual Basic Fundamentals

The chapters in this section introduce you to the basics of Visual Basic programming and working within the Visual Basic programming environment.

Part II: Programming with Visual Basic

The chapters in this section cover subjects that are fundamental to Visual Basic and also conceptually applicable to other programming languages.

Part III: The Elements of Visual Basic 6

The chapters in this section develop concepts and techniques that you learned in Part 1, while giving you a better understanding of Visual Basic as it relates to Windows programming.

Part IV: Advanced Programming with Visual Basic 6

This section introduces you to the advanced topics in Visual Basic programming and relates the language to ActiveX and Internet programming.

Part V: Database Programming with Visual Basic 6

This section shows you how to program Visual Basic to handle data access and databases.

Conventions Used in This Book

The following items are some of the features that make this book easier for you to explore:

Visual Basic's syntax for commands, scripts, and SQL statements also incorporates special elements. Look at the following syntax example:

For CounterVar = StartNum To EndNum [Step StepNum]
     statements
Next [CounterVar]

Most code listings include line numbers to make discussion about the code easier to reference. Don't include the numbers with any real-life Visual Basic code.


Next chapterContents

© Copyright, Macmillan Computer Publishing. All rights reserved.