10/29/99
2:27 PM
Page 1
O
N
E
Visual Basic
Database
Programming
Welcome to our book on Microsoft Visual Basic and ActiveX Data Objects
(ADO) programming. In this book, we’re going to see a tremendous amount of database programming using ADO—from simply moving through a database by clicking buttons in a form all the way to using the
Remote Data Services (RDS) on Web servers, learning about data shaping, using hierarchical recordsets, and creating ActiveX controls that act as data sources. There’s an immense arsenal of ADO programming power in
Visual Basic, and this is the book where we’ll put it to work.
ADO is Microsoft’s newest database protocol, which was built to provide an easy interface to the large Microsoft database-handling package, OLE DB. ADO is a flexible standard that is intended to supersede the two earlier standards: Data Access Objects (DAO) and Remote Data
Objects (RDO). In this chapter, I’m going to start examining ADO database programming by giving an overview of Visual Basic database programming in general, then taking a brief look at both DAO and RDO before turning to ADO. I’ll put all three of these protocols into historical perspective to give you an idea why ADO is so powerful and where it fits into the scheme of things.
You may wonder why there are three different sets of database protocols available in Visual Basic. As it turns out, the reason is historical.
1
Ch01
10/29/99
2
2:27 PM
Page 2
Chapter one • Visual Basic Database Programming
At first, Visual Basic only supported DAO, which connected to the Microsoft Jet database engine (the database engine in Microsoft Access). Then, recognizing that there are other database types available, Microsoft created the Open Database Connectivity (ODBC) standard, and supported ODBC with RDO in Visual
Basic. Finally, Microsoft saw that the Web and other forms of data—from email to Web content—were available too, and created ADO,