Bob Hall
rjhjr at cox.net
Mon Jul 12 16:54:13 CDT 2004
On Mon, Jul 12, 2004 at 02:55:50PM -0400, Susan Harkins wrote:
> >
> > My question is -- does checking a reference or modifying a reference
> > using the Reference object and its many properties and methods fall
> > into either category?
>
> No.
>
> From a Knowledge Base article on Access:
>
> "Dim objAccess As Access.Application"
> This type of declaration is called early binding, which is fastest.
>
> The article's example of late binding is
>
> Dim objAccess As Object
>
> "Binding" refers to binding a variable to an object. Setting a reference
> tells your code where a predefined class can be found. Of course, you've got
> to set a reference to do early binding, so the two tend to get mixed
> together.
>
> ===========Interesting take -- the terminology's the thing... :) So, the
> References collection and Reference objects are just explicit referencing --
> nothing to do with binding other than it enables early binding -- OK.
Right. Early and late binding are generic coding concepts; they have nothing to do with Microsoft or the Reference collection. The line
lngWibble = 47
is an example of early binding; the variable is bound to the specific value when the code is written. Note that the Reference collection isn't involved. The line
lngWibble = ReadSomeFileAndFetchWibbleValue()
is late binding. The variable isn't bound to the specific value until the code is run. Generally, late binding gives you more flexibility and early binding gives you more speed.