Microsoft Office 2000/Visual Basic Programmer's Guide   

ADO Component Libraries

Office 2000 installs the Microsoft Data Access Components (MDAC) version 2.1, which includes OLE DB components, a set of OLE DB providers, and six ADO components, each of which has its own set of functionality and corresponding object model. To minimize the memory use of your solution, you can reference only the ADO components your solution requires. It is beyond the scope of this chapter to discuss each of these components in detail, but the following table lists each ADO component and provides a brief description of its use.


ADO component

Description
Object library name
and ProgID
Microsoft ActiveX Data Objects 2.1 The core ADO functionality that allows you to open a connection to a data source, send commands (such as SQL statements), work with records, and handle any errors returned by providers.

Note   The component file for ADO 2.1 is named Msado15.dll. By default, this file is installed in the C:\Program Files\Common Files\System\ADO subfolder. This file's name is the same as for previous versions of ADO (back to ADO 1.5) in order to retain compatibility with older solutions. If you need to manually establish a reference to the ADO 2.1 library, you must reference the Msado15.dll file. Office 2000 also installs a type library file named Msado20.tlb in the same folder, but you shouldn't manually reference this file because it is installed to maintain backward compatibility with ADO 2.0 solutions.

Microsoft ActiveX Data Objects 2.1 Library

ADODB

Microsoft ActiveX Data Objects Recordset 1.5 A lightweight version of ADO that contains only the functionality of the ADO Recordset object. This version of ADO is typically used only from script in a Web page to minimize memory requirements. Microsoft ActiveX Data Objects Recordset 1.5 Library

ADOR

Microsoft ActiveX Data Objects Extensions for Data Definition Language and Security 2.1 Extensions to the base ADO functionality that allow you to perform data definition language (DDL) functions such as creating databases, and creating, modifying, or deleting tables, views (queries), stored procedures, indexes, and relationships. Also includes security objects to maintain security on user and group accounts, and to grant and revoke permissions on objects. Microsoft ADO Ext. 2.1 for DDL and Security

ADOX

Microsoft ActiveX Data Objects Multi-dimensional 1.0 Extends ADO to include objects specific to multidimensional data on online analytical processing (OLAP) servers, such as the OLAP extensions to SQL Server 7.0, which are named Microsoft SQL Server OLAP Services. Multidimensional data is conceptually similar to standard Excel PivotTable reports, with the option of supplying additional dimensions, using large data sets, and enabling more complete analysis. For more information about working with multidimensional data, search the ADO Help index for "Microsoft ADO MD Programmer's Reference" Microsoft ActiveX Data Objects (Multi-dimensional) 1.0

ADOMD

Microsoft Remote Data Services 2.1 Primarily used in Web-based, 3-tier applications, for example, as a component running on Internet Information Server (IIS) that is accessed from Active Server Pages (ASP) script running on a Web page to retrieve or update data. For more information about the Remote Data Services component, search the ADO Help index for "Remote Data Service Developer's Guide." Microsoft Remote Data Services 2.1 Library

RDS

Microsoft Jet and Replication Objects 2.1 Extensions to ADO to perform functions specific to the Jet database engine: compacting and encrypting databases, refreshing data from the cache, and creating and maintaining replicated databases. Microsoft Jet and Replication Objects 2.1 Library

JRO


Note   For detailed information about each of these ADO components, see ADO Help. You can view ADO Help from the Visual Basic Editor by searching for ADO keywords. In all Office applications that support the Visual Basic Editor, you can view ADO Help for collections, properties, methods, and events, but not all objects, by clicking an ADO keyword in your code and pressing F1, or by highlighting an ADO class or member in the Object Browser and pressing F1. Even if the message "Keyword Not Found" or "No Help Available" is displayed when you press F1 to display Help for some objects, you can still get help by searching ADO Help.

To view ADO conceptual and tutorial topics, after displaying a topic, click the Show button to display the contents for ADO Help; however, authored index entries for ADO Help aren't available when you browse Help from within Office applications. To display ADO Help in the stand-alone HTML Help viewer, which includes access to authored index entries from the Index tab, open the Ado210.chm file directly from the C:\Program Files\Common Files\System\ADO folder.

When you create a new Access database file (.mdb) or Access project file (.adp), the only reference that is automatically established when you create new modules or code behind forms and reports is to the Microsoft ActiveX Data Objects 2.1 object library. If you want to use the Microsoft ActiveX Data Objects 2.1 object library from other Office applications, or use any other ADO component libraries from other Office applications, you use the References command (Tools menu) to establish a reference manually.

When you use any ADO component from VBScript or JScript, you also need to use the #include statement to specify an additional file in your source code to provide the constants that define the enumerations used by ADO. For VBScript, specify the adovbs.inc file; for Jscript, specify the adojavas.inc file. By default, both of these files are installed in the C:\Program Files\Common Files\System\ADO folder. For information about using scripting in Office 2000 applications, see Chapter 12, "Using Web Technologies."

The following sections provide an overview of the base ADO 2.1 and ADO 2.1 Extensibility objects and an introduction to working with them.