Learn Access Now!      Chapter 16      Next Section in Chapter 17      Chapter 18

Chapter 17: Using OLE

(This is section 1 of 5 in this chapter)

In Chapter 15, "Importing and Exporting Information," you learned how Access can be a "good neighbor" by sharing data with other programs. In this chapter, you will learn how Access can work with other programs in a different way--by letting you link or embed information within a table. In short, this chapter teaches you how to take advantage of OLE, object linking and embedding, from within Access.

By the time you finish this chapter, you will understand the following key concepts:

What is OLE?

OLE (sometimes pronounced o-lay) is an acronym for object linking and embedding. When you use this technology in a program such as Access, you can combine information from different applications into your tables. For instance, you can combine text from a word processor (such as Word), spreadsheets or graphs from Excel, and graphics, sound, or video from a wide variety of sources--all within a single database.

There are actually two parts to OLE. The first is object linking and the second is object embedding. Object linking means that you can establish a dynamic connection or link between Access and another program. The magic of this link is that Windows ensures that any changes to the linked data are updated automatically within your Access database. For example, if you link an Excel chart into your table and later modify the spreadsheet data (from within Excel) on which the chart is based, the linked chart within your Access table automatically changes to reflect the modifications. If you had linked the chart to seven different tables, each table will automatically show the change.

Object embedding means you can insert information created by another application into your Access tables. Object embedding is different from object linking in two ways:

As you work with OLE, there are a number of terms you will come across. Some of them may seem quite foreign, but don't let that confuse you. As with any technology, there is always a series of special words you must understand. With OLE, there are three particular terms whose meaning you need to know:

As you examined the OLE terms, you may have gotten the idea that there are programs that provide information (servers) and those that receive it (clients). This is true, although some Windows programs have the capability to act both as a server and as a client. The extent to which a program implements OLE is up to the program's developers. Thus, some of your programs may be able to function as an OLE server, but not a client; some may not support OLE at all. Access has the capability to act as an OLE client. This means you can take information from other OLE servers, such as Excel, and insert it in your Access tables.

What Are Objects?

Notice that the definition of an object is fairly general. An object is information an OLE server program exchanges with OLE clients. The object definition is general on purpose, since objects really are nothing but information. Examples of objects include pictures, video, sound, text, images, or virtually anything else you can think of.

Don't confuse OLE objects with database objects. Throughout this book, you have learned about database objects and how to use them. Database objects include tables, queries, forms, reports, macros, data access pages, and modules. These are not OLE objects, however. In the Access environment, a program other than Access creates the OLE objects. Access simply stores the OLE object in a table.

Types of Objects Available

OLE is a programming specification, and any program that adheres to the specification can take advantage of OLE technology. This means that there is not a finite number of programs that implement OLE--any program can do it. The program's developers define the program's OLE capabilities.

A possible problem with OLE is the fact that not everyone has the same programs installed on their systems. For instance, there is a pretty good chance you have Access (most readers of this book will), and you probably have Excel and Word (since you probably have the Microsoft Office 2000 package). But that is about it. No other assumptions can be made about your system and what is on it.

So how do you find out what objects are available to you? It is quite easy, really. When you install a program under Windows, the program lets Windows know whether it can support OLE and to what extent. Windows stores this information in a registration database and uses it when you want to insert an object in your table. For example, when you are creating a form, you can choose the Object option from the Insert menu. When you do, Access displays the Insert Object dialog box shown in Figure 17-1.

Figure 17-1 The Insert Object dialog box.

The programs listed in the dialog box are those which registered with Windows as OLE servers. (Remember that your program list will probably be different from the one shown here.) This means that any of these programs can create objects (information) which you can link with or embed in your table. Later in this chapter, you will learn more about how to insert objects in your tables.

Learn Access Now!      Chapter 16      Next Section in Chapter 17      Chapter 18