Microsoft Office 2000 Developer |
The first step in accessing data is to create a data source that can be used in Office 2000 Developer. Depending on your final data needs, select a data source from one of the three following (or combine two or more):
The choice of data source depends on your answer to the question "How many databases do I need to connect to?" For example, you may have an Access database with employees' personal data and a SQL Server database containing data for each employee's business transactions. If you want to create a single report that includes data from both databases, you can use a single Data Environment designer (which allows multiple connections to be created), two ADO Data Controls, or the ADO Recordset Library to create two Connection and two Recordset objects.
On the other hand, if you are creating a data assistant application, one that simply presents data from one database, then you only need one connection. In that case, any of the three will suffice. However, if you want to display hierarchical recordsets with a Hierarchical FlexGrid control, you must use the Data Environment designer.
One of the most powerful new features in Microsoft Office Developer is the Data Environment designer, which provides an easy-to-use, design-time interface for creating business rule-specific, ADO-based COM objects. You can create reusable objects (with their own properties, methods, and events) that aggregate data from different database tables residing on separate databases. Each object can easily be moved and bound to a control on a form with a few lines of code.
Although the Date Environment designer has a more user-friendly environment for specifying connections to databases than some of the other data access options, it only works from a stand-alone project.
More Information about the Data Environment Designer
Overview documentation on using the Data Environment designer can be found in the Data Access Guide in the MSDN Library. For an overview of the Data Environment object, see "About the Data Environment Designer" in the Visual Basic Programmer's Guide. For information on designing a DataEnvironment object, see "Designing a DataEnvironment Object" in the Visual Basic Programmer's Guide.
The ADO Data Control (ADODC) allows you to quickly create connections between data-bound controls and data providers using the simplicity of ADO, but each control allows only one connection at a time. For Office developers who are comfortable with Remote Data Objects (RDO), ADODC is similar in function but significantly more powerful than RDO.
With the ADODC in your project, you can simply drop it on a form, set some connect properties, add some text boxes and labels, bind the text boxes to the ADODC, and then run the form. The ADODC handles the connection through ADO/OLE DB and binds the text boxes to the database table.
More Information about the ADO Data Control
For an overview of the ADO Data Control, see "Using the ADO Data Control" in the Visual Basic Programmer's Guide. For reference information, see ADO Data Control.
ADO supplies an open, application-level data access object model that allows you to write database applications over OLE DB data using any language. The ADO Library allows you to create multiple connections and Recordset objects. Through ADO, you now have access to more types of data than ever before.
More Information about the ADO Object Library
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.
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.