[AccessD] Missing references

JWColby jwcolby at colbyconsulting.com
Fri Feb 16 09:02:31 CST 2007


I would have to take issue with that statement Jim.  The resolution of the
object certainly takes longer, but often times that time will be dwarfed by
other things.  For example suppose I late bind excel objects.  Yes, it takes
longer to resolve the reference, but How long does it take to Open Excel?
To make a new sheet?  To insert data from a query into the sheet?  To save
the sheet back to disk?

I do understand your point and I think there are situations where it can be
critical, inside a loop executing a million times for example, but many
times the effect on overall system operation will be negligible.

And then there is the simple matter of "yea, it affects the time, but it
simply doesn't matter since I have no idea what version of the library the
user will have on their machine".

In such a case, the fact that it "just works" outweighs all other
considerations.

John W. Colby
Colby Consulting
www.ColbyConsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Dettman
Sent: Friday, February 16, 2007 9:50 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Missing references

Bryan,

  One thing you didn't mention is the performance hit; late binding costs
you 10-15% for every operation perform.

Jim. 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bryan Carbonnell
Sent: Thursday, February 15, 2007 4:38 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Missing references

On 2/15/07, Mark A Matte <markamatte at hotmail.com> wrote:

> Since I'm not versed in Binding(Late or Early) ...I've looked at MS 
> knowledge base...and most of what I found was problems and fixes.
>
> Any suggestions for 'crash course READING' in bindings?

Here's a quick description that I lifted from an article I wrote
http://www.databaseadvisors.com/newsletters/newsletter072002/0207wordautomat
ionlpt1.asp


Early Binding Versus Late Binding

First you need to decide whether to use Early Binding or Late Binding.
Early Binding allows you to dimension variables by their specific data type.
For example, the following declarations refer to the Word Application and
Document objects rather than declaring both as generic
objects:

Dim objWord as Word.Application
Dim doc as Word.Document

Early Binding also enables a few built-in Intelli-sense features: Auto
Complete, Auto List Members, and Auto Quick Info. In addition, using early
binding allows you to view Word's object model in the Object Browser.

The downside to Early Binding is that you have to set a reference to a
specific version of Word. Sometimes Access is smart enough to change the
reference to the specific version of Word that is installed on the PC you
are deploying your application; often it isn't, and you could end up with
problems relating to the references.

If you decide to use Late Binding, you will have to dimension all of your
variables as Objects as follows:

Dim objWord as Object
Dim doc as Object

Consequently, you cannot access any of your variables until you set them to
a specific object as shown below:

Set objWord = CreateObject("Word.Application") Set doc =
objWord.Documents.Open("C:\Path\To\file.doc")

In addition, the Intelli-sense features, Auto Complete, Auto List Members,
Auto Quick Info and disables viewing of Word's object model in the Object
Browser. However, Late Binding doesn't require that you set a reference to
any Word Object Library, which can be advantageous if you are deploying
run-time versions of your application to mixed OS/Office Version platforms.

Instead of choosing one or the other, we suggest you compromise and use
both. During the development phase use Early Binding. Once you release the
application, remove all specific references and change each to Object-the
best of both worlds!

Now that the binding issue is resolved, let's roll up our sleeves and dive
into writing some code.



--
Bryan Carbonnell - carbonnb at gmail.com
Life's journey is not to arrive at the grave safely in a well preserved
body, but rather to skid in sideways, totally worn out, shouting "What a
great ride!"
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list