Chapter 12. Loading and Manipulating Data
A lot of data is managed in and never leaves an Excel worksheet. But much of the data that Excel users work with comes from external databases such as SQL Server, Oracle, or Microsoft Access. You can work with data in various ways in Excel, usually by importing an entire table of data from a database or by using a query to import data that meets specific criteria. From a developer’s perspective, you also have great programmatic control over the data you expose to users.
The Excel object model lets you create and manipulate queries from a variety of sources using the QueryTable object. If you want more programmatic control over your data, you have a choice of two programming interfaces. The ActiveX Data Objects (ADO) interface gives you access to data from a variety of data sources. The Data Access Objects (DAO) interface, which is native to Access databases, provides an easy-to-use interface for working with Access data.
In this chapter, I show how to:
Work with
QueryTableobjectsWork with
ParameterobjectsWork with the ADO and DAO database programming interfaces
This chapter contains reference information for the following objects and their related collections: QueryTable, Parameter, ADO.Command, ADO.Connection, ADO.Field, ADO.Parameter, ADO.Record, ADO.RecordSet, DAO.Database, DAO.DbEngine, DAO.Document, DAO.QueryDef, and DAO.Recordset.
Tip
Code used in this chapter and additional samples are available in ch12.xls.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access