1. Home
  2. Computing & Technology
  3. Databases

Microsoft ActiveX Data Objects (ADO)

By Mike Chapple, About.com

If you're like most database developers, you require frequent access to a wide variety of data sources -- server-based databases, desktop databases, spreadsheets, text files and more. The thought of attempting to develop custom interfaces for each of those sources is enough to drive even the most dedicated software engineer off the deep end! Fortunately, if you're developing in a Microsoft environment, ActiveX Data Objects relieve a large portion of that burden by providing an abstract high-level interface that works with nearly any data source.

Microsoft holds a dubious reputation in the software development industry based on their past efforts to crowd out competitors and force developers and end users to work in a strictly Microsoft environment. No so with ADO! In an attempt to keep developers from switching to non-platform-specific development environments like Java, Microsoft included ADO drivers for almost any data source you can imagine -- text files, Oracle databases, IBM DB2 databases and Excel spreadsheets join the expected Access and SQL Server databases on the list of support products.

ADO is an application programmer's interface (API) that provides developers with an easy way to access the underlying OLE DB data access interface. It's part of Microsoft's overall Component Object Model (COM) strategy and, as such, works in a variety of environments ranging from Visual Basic to Active Server Pages.

The ADO object model is actually quite simple -- there are only six total objects:
  • The Connection object sets up a link between your program and the data source. This object contains all of the necessary configuration information and acts as a gateway for all of the other ADO objects. The Connection object is mandatory -- all implementations of ADO must support it.
  • Each Connection object may have an associated collection of Error objects. ADO utilizes this collection when the connection returns more than one error message at a time. This collection is optional.
  • The Command object represents a SQL statement or stored procedure that software executes against the datasource. Use of Command objects is optional -- data can be extracted directly from a Connection object, if desired.
  • Command objects may have an associated collection of Parameter objects that provide additional information to the data source when executing the command. The Parameter collection is optional.
  • Each command execution results in a Recordset containing the results of the query. This object is a mandatory part of ADO.
  • Each Recordset object is composed of a number of Field objects that represent individual columns in the Recordset. This object is a mandatory feature of ADO.
ADO provides a quick, easy way to access data from a variety of development environments. You won't regret investing a few hours of your time in an exploration of the object model and it's many uses.
Explore Databases
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Databases
  4. Development
  5. Microsoft ActiveX Data Objects (ADO)>

©2009 About.com, a part of The New York Times Company.

All rights reserved.