Programming Microsoft Visual Basic 6 Ebook Edition In its six versions, Visual Basic has evolved from the simplest programming language for Microsoft Windows to an exceedingly complex development environment, capable of delivering virtually anything from tiny utilities to huge n-tier client/server applications. For this reason, the job of writing a book that encompasses all the language's features has become a daunting task, and I was actually intimidated when I began to write this book. I would have preferred to write several books on specific topics, or at least this is what I thought at first. It took me some months of hard work, but in the end I managed to put everything I wanted to write about in one big tome. I believe that from the reader's point of view this is much better than having to deal with a collection of books or one thick volume written by several authors. One big book by one author ensures a uniform approach to problems and no redundancy. Nevertheless, Programming Microsoft Visual Basic 6.0 has been such a large undertaking that I like to think of it as many books in one. The following list will help you to understand what you'll find in it. A survey of the new Visual Basic 6 features Visual Basic 6 includes many new features, especially in the database and Internet areas. Among these are ADO, DHTML applications, and WebClasses, just to mention the outstanding ones. I have explored these new features and shown you how you can take advantage of them to create the next generation of your applications. But at the same time, I've noted some of their rough edges, so you won't be lost when you find that something doesn't work as expected. This is one of the advantages of a book that isn't rushed to the market as soon as the product is released. A demystifying tutorial on object-oriented programming You've been able to build classes using Visual Basic since version 4, yet a relatively small number of developers actively use objects in their applications. This isn't surprising, after all, since most of the available OOP code examples are "toy classes" that deal with dogs, fleas, and other animals. This hardly stimulates the imagination of programmers who must deal with invoices, products, customers, and orders. You won't find the source code for a complete object-oriented invoicing application in this book, but you'll surely learn a lot about practical uses of classes in Chapters 6, 7, and 9 or by browsing the 100 classes on the companion CD, some of which can be immediately reused in your applications. And in Chapters 16 through 20, you'll see how you can leverage your OOP skills to create ActiveX controls, local and remote ActiveX components, and exotic variations such as components for ADO, RDS, and ASP. An in-depth reference to Visual Basic and the VBA language I didn't want to write a book that simply rehashes the language manuals and the on-line help. If you want to know the syntax of Visual Basic's keywords, don't buy a book: Just press F1 and see what appears on the screen. I've organized the material in Chapters 2 through 5 so that each property, method, and event is introduced only when it becomes logical to do so. Even more important, you'll see all these features in action, with a lot of source code for you to study. A closer look at ADO technology Database programming is important for most Visual Basic developers, and ADO has much to offer in this field. That's why I devoted 4 out of 20 chapters—that is, Chapters 8, 13, 14, and 15—to it, covering the basics to more advanced topics, such as optimistic batch updates, asynchronous operations, hierarchical Recordsets, and some of the ADO 2.1 new features. Moreover, Chapter 18 covers data-aware components and OLE DB Simple Providers. And Chapter 19 includes a section about Remote Data Services, which shows how you can create thin clients that access a remote database through the Internet. A painless introduction to Internet programming Visual Basic 6 can create great Internet applications, but it requires that you already know the basics of HTML, Dynamic HTML, VBScript, and Active Server Pages development. For this reason, Chapters 19 and 20 include tutorials that cover all these arguments, plus an introduction to Microsoft Internet Information Server 4 and a guide to creating ASP components. Armed with this knowledge, you'll find using the new Internet-related features a breeze. A transition guide for Visual Basic 5 developers Each time a new version of the language is released, programmers are eager to know what has changed from the previous one. It's not just a matter of curiosity: Programmers need to determine how long it will take to port existing applications to the new version. And, of course, they need to ensure that the new features don't have a negative impact on the existing code. Throughout the book, each description of a new Visual Basic feature has been marked with a NEW icon so that developers can spot the new features quickly. A digest of advanced programming techniques To some developers, doing advanced programming means writing a lot of API calls, possibly with some obscure and tricky techniques that only a few experts can understand. The truth is that you can solve several thorny programming problems with nothing but the power of Visual Basic, as I'll demonstrate throughout the book. But if you like API programming, you can refer to the Appendix to learn how to access the Registry, exploit the hidden features of Visual Basic controls, and master advanced techniques such as subclassing. You'll even find a ready-to-use DLL for safe subclassing inside the environment, together with its source code. Just a few other notes about the five-part structure of the book Part I, "The Basics," is about general programming. Chapter 1 is an introduction to the environment for those who have never worked with Visual Basic. Chapters 2 through 5 focus on forms, intrinsic controls, and the VBA language, and contain a lot of reusable, optimized routines. Chapters 6 and 7 cover all the object-oriented features that will be exploited in the rest of the book. Chapter 8 introduces the new Visual Basic 6 database features, including Visual Database Tools and the DataEnvironment designer, and it defines a few concepts that are made use of in Part II, but that will be completely developed only in Part III. Part II, "The User Interface," takes a closer look at forms and ActiveX controls. Chapter 9 builds on the object-oriented nature of forms to create reusable user interface modules, parameterized forms, and generic MDI containers that can be reused as is in many applications. It also shows how you can exploit the dynamic control creation feature to create data-driven forms. Chapters 10 and 11 describe all the Windows common controls that come with Visual Basic, including the newer ImageCombo, MonthView, DateTimePicker, and CoolBar controls. Chapter 12 covers a few of the other controls that are provided in the package, such as the MaskEdBox and SSTab controls. Part III, "Database Programming," continues where Chapter 8 left off. Chapter 13 explores the ADO 2 object model, with a detailed description of all the properties, methods, and events. It also covers the DDL and security extensions provided with ADO 2.1. Chapter 14 illustrates how you can apply ADO in real-world programs and covers more advanced topics such as hierarchical Recordsets and stored procedures. Chapter 15 is about additional tools and controls that you can use for easily creating database applications, such as the DataGrid control, the Hierarchical FlexGrid control, and the DataReport designer. Part IV, "ActiveX Programming," covers the ActiveX components that you can create in Visual Basic. Chapter 16 describes ActiveX code components, from the basics to advanced topics such as COM callbacks, multithreading, satellite DLLs, and DCOM security. Chapter 17 is about ActiveX controls and guides you through the creation of useful controls of increasing difficulty. It also covers major new Visual Basic 6 features in this area, such as windowless controls, and some advanced techniques for the best performances. Chapter 18 illustrates the new types of ActiveX components that you can create with Visual Basic 6, such as data source and data consumer components and OLE DB Simple Providers. Part V, "Internet Programming," consists of just two long chapters. Chapter 19 is about client programming: It includes tutorials on HTML, Dynamic HTML, and VBScript, followed by an in-depth description of the DHTMLPage designer. This chapter also contains a detailed coverage of Remote Data Services, including the exciting capabilities offered by components that you can instantiate on a remote Web server. Chapter 20 is about programming for Internet Information Server 4: It begins with a tutorial on the ASP object model, continues with the creation of components for Active Server Pages, and ends with an in-depth description of the new Visual Basic 6 WebClasses. The step-by-step descriptions guide you through the creation of a complete ASP application that lets remote users place their orders using a database of products. Click the compilation html & enjoy!