What s ADO and Why Do You Need It?

 < Day Day Up > 

What's ADO and Why Do You Need It?

The data you enter into an Access database isn't actually stored in the database objects. Forms, tables, reports, and even queries are just interface objects by which you input, view, and retrieve data. Fortunately, Access handles the data exchange behind the scenes you don't need to know what's going on or even that it is going on. You benefit from the process, regardless.

Things get a bit more complicated when you start using code to interact with your data. That's where the ActiveX Data Objects (ADO) library comes into the picture. In a nutshell, ADO is an object model that provides a few specialized objects for retrieving data. ADO is your ticket to accessing all types of data, not just Access data.

You don't have to do anything special to get ADO it's already there. Starting with Windows 2000, ADO comes with and is installed with the operating system. In addition, ADO has been the Access data access library default since Access 2000, so you don't even have to reference the library to use the objects.

The ADO Object Model

Like other object models, the ADO object model is a hierarchy of objects. Figure 16.1 is an illustration of the ADO object model. The model consists of collections of specific object types. King of the ADO hill is the Connection object, which represents a single connection to an OLE DB data source. This chapter reviews the ADO Connection, Command, and Recordset objects.

Figure 16.1. The ADO object model consists of objects.

graphics/16fig01.gif


NOTE

ADO and OLE DB work together. OLE DB interfaces with the data and translates the data processing components from one format to another using two types of components: providers and consumers.

Providers are programs that talk to one another (expose data). Consumers then use the exposed data.

ADO is a consumer. In other words, OLE DB connections let you actually connect to the data and ADO objects let you retrieve the data after you're connected.


     < Day Day Up > 


    Automating Microsoft Access with VBA
    Automating Microsoft Access with VBA
    ISBN: 0789732440
    EAN: 2147483647
    Year: 2003
    Pages: 186

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net