The information in this article applies to:
SYMPTOMS
Advanced: Requires expert coding, interoperability, and multiuser skills.
MORE INFORMATIONAn easy way to see the difference between early and late binding is to look at the way objects are declared in code. Code that implements late binding uses the "As Object" clause when dimensioning the variable, and sets the object using the CreateObject function during run time. Code that implements early binding declares the object at the start of the code by using the Dim statement. Example of Late BindingLate binding means the object is created when you run the code. The object is then set after the object is declared. For example, to connect to Microsoft Excel by using late binding, you can implement the following lines of code:
Example of Early BindingEarly binding means you declare the object and name the object class type within the same line of code. There is no "As Object" clause in the Declaration section. For example, to connect to a Microsoft Excel worksheet by using early binding, you can implement the following code fragments:
Example of Late Binding with Microsoft GraphBecause Microsoft Graph 8.0 does not support early binding, the only way to connect to the Microsoft Graph object model is by using late binding, as shown in the following example:
For more information about late binding, please see the following article in the Microsoft Knowledge Base: Q138138 INFO: Late, ID, Early Binding Types Possible in VB for Apps For more information about early and late binding when using Automation, search the Help Index for "CreateObject Function." For more examples of using Microsoft Graph with Microsoft Access, see the Graph Sample Database Grphsm97.exe. For information about how to obtain this sample file, please see the following article in the Microsoft Knowledge Base: Q186855 ACC97: Microsoft Access 97 Sample Graphs Available in Download Center
Keywords : kbdta AutoGrph |
Last Reviewed: November 10, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |