Microsoft Office 2000 Developer   

Accessing Data Using Office 2000 Developer Tools

See Also

Databases exist on many platforms — Access, SQL Server, Oracle, and mainframes. The challenge is to take any form of data and make it available in Office 2000 applications. In Microsoft Office 2000 Developer, this is accomplished by using the ActiveX Data Objects (ADO), which is the premier technology for creating data connections.

Detailed documentation about the ADO object model can be found in the MSDN™ Library. See Getting Started with ADO 2.0 for an entry point into the documentation. More documentation about the ADO Data Control and the ActiveX Data Object Library can be found in Chapter 14, "Working with the Data Access Components of an Office Solution," of the Microsoft Office 2000/Visual Basic Programmer's Guide.

For information about object models, see the Microsoft Office 2000 Object Model Guide and Chapter 4, "Understanding Office Objects and Object Models" in the Microsoft Office 2000/Visual Basic Programmer's Guide.

To access data that resides on almost any platform, the process requires four distinct parts.

  1. Data — the actual data, residing either on a server or on the same machine as the solution.

  2. OLE DB Data Provider — software that provides a connection to almost any platform. Office 2000 Developer includes OLE DB providers for Access, SQL Server, Oracle, and ODBC databases.

  3. Data Source — an intermediate software component that encapsulates the connection to the OLE DB data provider. Office 2000 Developer supplies three data sources: the ADO Recordset Object, the Data Environment designer, and the ADO Data Control.

  4. Data Consumer — the final software component that displays data, either a data-aware control, a non data-aware control bound to the data source using the BindingCollection object, or an Office application form. For example, you can display data by inserting a data-aware control, such as the Hierarchical FlexGrid, into several Office applications or by importing the data directly into an Excel worksheet using the functionality with the application.

Example Process for Displaying Data

In Office 2000 Developer, this process could be implemented in the following way.

  1. Determine which databases you require and their path(s).

  2. Configure either the Data Environment designer, the ADO Data Control, or ADO objects as data sources. (See Creating a Data Source Using Data Connectivity Tools for more details.)

  3. Determine which Office 2000 application will be used, and open a new document in the application.

  4. Open the Visual Basic Editor (ALT+F11).

  5. Insert the appropriate controls into the Office 2000 document or the Visual Basic UserForm to display the data. For more information, see Displaying Data from a Data Source.

    -or-

    -or-