|
Chapter 1: What is ADO?
ActiveX Data Objects or ADO, as it is more popularly known, is a Microsoft
technology that they introduced during the last quarter of 1996. Originally, it was
intended to provide a database independent method of accessing data from a wide
range of databases. This means you can use the same functions whether you are using
Access, Microsoft SQL Server, Sybase, Oracle etc. as your database engine.
Microsoft had already pioneered the ODBC (Object DataBase Connectivity) interface
standard years ago and it was widely used in the industry, but it was outdated and
the cracks were beginning to show. Hence, Microsoft went for a new programming
standard and thus ADO was born.
|
Some other languages, notably Perl and Delphi, also provide database independent
methods of accessing data via their DBI or BDE interfaces. However, ADO was also
intended to be somewhat language independent, provided your language had support for
COM interfaces. Thus, you can use ADO with Python, Delphi, VB, ASP, Visual
C++, any .NET language, Borland C++ Builder etc.
Originally ADO was only intended to work with relational databases, but
its role has been enhanced in recent years.
With version 2.5, ADO also gained the capability of dealing with folders,
e-mail messages, text files etc. With version 2.7 came the ability to work with XML
and engines like SQL Server 2000. This tutorial will deal with using ADO to talk
to databases alone and leave the other stuff for another article perhaps.
|
One disadvantage of ADO is that its usage is currently restricted to Microsoft
operating systems (Windows 98, 2000, ME, XP etc.) alone. Their earlier ODBC standard
was gradually accepted by other vendors and thus you can find ODBC drivers for
UNIX platforms as well. Hopefully the ADO model will move in that direction one day.
For now though, it means that a client program that uses ADO can only run on Windows.
However, the database server that the client program connects to, can run on any platform.
Hence, this is not a severe issue because this is the setup that most sites have -- (i.e.)
client machines running on Windows connecting to a database server that may be running
on Windows, *NIX or whatever.
|
Advantages
- Designed to be database independent.
- Language independent, provided language has a COM interface.
Python, Perl, Visual Basic, Visual C++, Delphi, ASP,
C++ Builder, Ruby, Java, C# and other .NET languages all support
COM interfaces and can thus use ADO.
- Wide variety of drivers available. You can use ADO to talk to databases
such as:
- Access
- Microsoft SQL Server
- Oracle
- MySQL
- Postgres SQL
- Sybase
- Firebird
- Interbase
- DB2
- Newer ADO versions can interface with XML, folders on disk, Microsoft Excel, Microsoft Outlook etc.
Disadvantages
- A program that uses ADO to connect to the database can only
be on a Microsoft operating system currently. The database
itself can be on a non-microsoft platform though. In fact, the MySQL
examples in this tutorial were executed by the author from a Windows 2000 Pro
client computer connecting to a Linux server running MySQL.
|
|
Now that you have a basic idea of what ADO is and what it
can do for you, we will begin to explore the various objects in the next chapter.
|
|
Copyright © 2004 Mayukh Bose. All rights reserved.
This work may be freely reproduced provided this copyright notice is preserved.
OPTIONAL: Please consider linking to this website (
http://www.mayukhbose.com/) as well.