• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 22. Automation: Communicating wi... > Early Binding Versus Late Binding

Early Binding Versus Late Binding

Binding is another important automation concept. Two types of binding are available with automation components: early binding and late binding. With early binding, you create a reference to a component's type library. This notifies Access of all the library's objects, properties, methods, and events. With late binding, you instantiate objects at runtime without referencing them at design time. VBA doesn't know anything about the objects that you are creating until runtime.

Most objects that you automate support early binding. You should use early binding whenever possible. Early binding has several benefits. Because each object's properties and methods are resolved at compile time, early binding is faster and more efficient. Furthermore, after you create a reference to a type library, all of the library's objects and their properties and methods are available via Intellisense. Finally, online help is available for any type libraries that you have referenced. This means, for example, if you have referenced Excel's library from Access, the process of placing your cursor on an object, property, or method and pressing F1 displays help for the selected item.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint