Programming Access Databases
In this chapter
In the past few chapters, you've learned about the objects, properties, and methods associated with Word, Excel, and PowerPoint. You've seen that it's possible to manipulate these objects to automate routine tasks and gain an unprecedented amount of control over these programs.
In this chapter, you'll see that using VBA with Access is quite a bit different because you won't learn anything about Access objects. Yes, Access does have an Application object, and there's a whole hierarchy of objects for things like forms and reports. However, it's a rare that a VBA programmer ever has to manipulate Access using these objects. Instead, what Access programmers really want to get their hands on is the data contained in Access tables and queries.
The secret to doing this is that database info is accessed using an entirely different object hierarchy altogether. It's called ActiveX Data Objects (ADO) and it's the link between your Access VBA programs and the databases, tables, and queries you want to work with. The amazing thing about all of this is that you can use ADO to work with Access databases from other Office applications. For example, you could use ADO programming to grab data from an Access table and insert it into an Excel range. This chapter takes you through the basics of using ADO to access and work with Access databases.