By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,493 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,493 IT Pros & Developers. It's quick & easy.

Update references from code

P: n/a
I update code on several machines and find myself constantly correcting
references (e.g. Word 11 to Word 9, adding ADO x.x library, sometimes
even Jet Expression Service Type Library) when I copy the newest
version to another machine.

Some run Windows 2000, some XP, various versions of Office.

I need a method of doing this in code when the start screen is loaded:
1. checking the current computer for the latest version of all needed
references
2. updating all references.

I am using Access 97, though on some machines I convert it to 2003.

May 5 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Why not just use late binding? Then you don't have to change or check
the references at all...

May 5 '06 #2

P: n/a
Okay, I've done that for Word & Excel, but what about ADO? I am not
sure how to do that.

May 5 '06 #3

P: n/a
pe***********@aol.com wrote:
Okay, I've done that for Word & Excel, but what about ADO? I am not
sure how to do that.


Maybe
http://support.microsoft.com/kb/172733

/jim
May 5 '06 #4

P: n/a
<pe***********@aol.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Okay, I've done that for Word & Excel, but what about ADO? I am not
sure how to do that.


Without question, you need late binding for word/excel etc.

As for ADO?

You should NOT NEED to mess with the ado references, and I have no idea why
you are....

Of course, you do need to cut a version of your software for a particular
version of office. You can't expect software developed in a2000 to work with
a2003 unchanged. (often it does..but, really, you need to create a version
for each office you are using).

It is not clear what machines/versions you are distributing your application
to, but I would suggest you that distribute a mde. So, if users need a 2000
version, then you distribute a a2000 mde. If you use the default ADO
reference for each version, then you will not have nay problems at all.

I would STRONGLY recommend that you don't mess with the ADO reference, but
just use the default one for the particular version....

The problem here is that a97 does not have built in support for ado...so, I
not really sure why you are having a problem anyway. Are you mixing dao and
ado code in the same application? (and, if you are...why are you???).

For a2000 to a2003, you should not need to touch, or change the ado
reference anyway. Further, you should not as a rule have to change any code.

So, fix the late binding for other office applications, and leave the ado
ref alone...it should work ok....

However, for a2000 to a2003, while they all default to a2000 format, you
REALLY REALLY REALLY REALLY need to do a de-compile and then a re-compile in
a2000 (or a2002) to ensure ANY degree of relibliry here. So, if you move the
mdb to a different version of office, do a de-compile..and re-compile first.
(or, as mentioned, create a mde for each version of office...but you still
want to do a de-compile before you create the mde if you follow this
advice).

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
http://www.members.shaw.ca/AlbertKallal

May 6 '06 #5

P: n/a
>Albert D. Kallal wrote:
As for ADO?
You should NOT NEED to mess with the ado references, and I have no idea why
you are...


Well, to tell the truth, I kind of wondered about that myself. So I
just went to "Machine2" so I could document the problem for you
precisely, and LO AND BEHOLD, it has disappeared.

But, for the sake of curiosity, I'll describe what used to happen.

Develop on Machine1 - running Windows 2000 SP4, Access 97 SR2, Jet
Copy to Machine2 - running Windows XP, Access 97 but also has Access
2003 SP2

Word & Excel would update themselves from version 9 to version 11, but
not vice-versa (e.g. if I happened to copy from 2 to 1 I had to
manually change references. So, ok, I got rid of those references &
used late binding as recommended here, which is really not a problem
because there are maybe 2 or 3 places where we use either one).

As far as I can now recall, on Machine2 no functions would work until I
manually checked a reference to Microsoft Active-X Data Objects 2.7
library.

And now, suddenly, that is checked all by itself, and actually I still
see it on Machine1.

So, what has changed? Late binding of Word & Excel. And, have
installed RTF Control from Steve Lebans, with RTF2 Active-X Control
module. Could that be what makes the difference?

May 10 '06 #6

P: n/a
Great...sounds like things are working much better...
So, what has changed? Late binding of Word & Excel. And, have
installed RTF Control from Steve Lebans, with RTF2 Active-X Control
module. Could that be what makes the difference?


The late binding likely does help, since then you don't have a bunch of
references that need to be changed, or can break....

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
http://www.members.shaw.ca/AlbertKallal
May 10 '06 #7

P: n/a
So, are you saying that early binding of Word & Excel could have caused
the ADO ref to break?
I guess it's just one of those bugs, er, features?

(and, I also at one point had to add JET Expression Service Type
Library. I think I've even seen the DAO Object Library break.
Fortunately, a bit of googling this group & I was usually up and
running pretty fast. Thanks, all.)

May 10 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.