Jeff Webb, Mike McKelvy, Ronald Martinsen, Taylor Maxwell, Michael Regelski September 1995 Special Edition Using Visual Basic 4 - Introduction 1-56529-998-1 Computer Programming computer programming Visual Basic OLE database applications ODBC VB VBA API This book is an all-in-one reference that provides extensive coverage of every topic and technique for creating optimized and customized applications with Visual Basic.

Introduction


The other day I was browsing the software store, kids in tow, poking at the new boxes. I was trying to figure out the feature set described on the various editions of C when another dad informed me that I needed a 32-bit operating system to run the contents of the box that I was reading. I hadn't realized this and thanked him, but told him it was okay, I could do 32-bit. He said it was a big problem for him, because he did multimedia work, and much of the DOS work in which he had invested simply didn't work on those platforms.

I'm not sure whether he thought Microsoft should be entirely dedicated to building a better DOS, but I choose to think that his comment was somewhat more profound: Programming in a changing environment is really tough. Not tough physically, of course-your typing speed might exceed your ability to bench-press. Change is not even tough intellectually-you're always learning. What's tough about change is leaving behind something on which you have worked hard.

There is perverse frustration in realizing that a general procedure that you spent two days developing has been replaced by a new property on the list box control. This frustration deepens if the new property works better and faster than your original scheme. This type of frustration is a good sign-it means that you've pushed your tools as far as they'll go.

Visual Basic 4.0 contains more new features than any previous update. But simply enumerating new features misses the larger picture: the nature of the problems that you are used to solving has changed. Therefore, you might have to leave behind more than just a few procedures. You also might have to shed old ways of thinking about problems to adopt new approaches. This new version of Visual Basic embodies four fundamental changes in Windows programming:

Each of these topics is big enough to merit its own product version and a book to cover it. As much as we would like to sell you four separate books, Que decided to follow Microsoft's lead and bundle all these features into this single Special Edition. By targeting the new areas, this book gives you a leg up preceding both how to use the new features and how to think within this new framework for Windows development.

A New Jet Engine

It's very easy to get started with database programming in Visual Basic-and also very easy to find yourself quickly enmeshed in a tangle of data-oriented programming issues like integrity, multilevel security, efficiency, and normalization. Part 1 of this book, "Data Access," leads you through the tasks and concepts involved in creating a usable database with Visual Basic's new Jet engine. Jet 2.5 builds in solutions to many programming problems in earlier versions:

Part 1 explains what each of these features means to you and how you can best take advantage of them when designing and programming with databases.

VB 4.0 Does for OLE What VB 1.0 Did for Windows

You might remember the introduction of Visual Basic. Microsoft has just released Windows 3.0, and the environment was starting to take off. The catch was that you had to program applications for Windows 3.0 in assembly or C, using a huge, obscure application program interface (API). Then Microsoft released Visual Basic 1.0. Suddenly, just about everyone was cranking out good-looking Windows applications. A simple "Hello World" application took only one line to code rather than the 200 lines required in C.

Visual Basic 4.0 is the equivalent epiphany for OLE developers. You can add OLE features to Visual Basic applications with little or no code. In C, you have to deal with hundreds of new functions in the OLE API and write thousands of lines of code to implement similar features. You can't do everything in Visual Basic that you can in C, but you sure can get further faster.

Therefore, you'll soon see thousands more OLE applications. Also, OLE-enabled applications will become the de facto industry standard, just as Windows did.Part II, "Using OLE," tells you how to build applications by using OLE objects from other applications. Part III, " Creating OLE Objects," explains how to create your own "parts" for use in your own applications, other Office applications, or within Visual Basic itself.

Working with 16- and 32-Bit Applications

Visual Basic is code-compatible between 16- and 32-bit operating systems. Therefore, the same code that runs under Windows 3.1 works on Windows NT 3.5 or Windows 95. However, the system services and APIs on 16- and 32-bit systems differ significantly.Throughout this book, 16- and 32-bit differences are indicated and explained. This enables you to anticipate differences and to create and distribute applications that run naturally on both platforms.

Developing with Office Applications

The Microsoft Office Development Kit (ODK) is a big part of the Visual Basic Professional Edition. Part IV, "Integrating with Office Applications," tells you how to use Microsoft Office applications to create unique applications quickly. All the Office applications share some form of BASIC. Each dialect and object model differs, however. Part IV compares programming in each product and helps you take advantage of the unique aspects of each Office application.

Advanced Programming Techniques

Part V, "Optimization and Techniques," covers general programming techniques that help you optimize and improve the appearance of your Windows applications.

What's Covered in This Book

It's always intriguing how a software product can add huge new regions of features, yet the documentation that accompanies the product stays about the same size. The new features don't replace the old ones so...does the print get smaller? What actually gets squeezed is the material-and because the new material is the hardest to create, it usually gets squeezed the hardest. The advantage of writing a book like this one is that you get to write for a longer period of time than the product documentation team. Therefore, you can include more material without worrying about "busting the box." Because Visual Basic 4.0 introduces so much new material and the Visual Basic Programmer's Guide adds so little new documentation, books like this one are becoming essential add-ons for using each new version of Visual Basic. This book covers in great detail the material that is new to Visual Basic 4.0. Each part introduces its topic carefully before delving into the complete and sometimes gnarly programming details of the topic. The book is broken into these five major parts:


© 1996, QUE Corporation, an imprint of Macmillan Publishing USA, a Simon and Schuster Company.