Question on references

T

Tony

Hi All,

I've got a database into which I have to import data from MS Word. I
initially made a reference to 'Microsoft Word 11.0 Object Library' for this
purpose. I thought everything was fine until I tested on the server and
realized that Word is not installed on the server (Access is, but only for
the purpose performing some nightly routines).

So, my problem was that I have clients running Office 2000 (10.0), Office
2003 (11.0), and server with only Access installed. I think I can get
around this by putting the required .OLB file on the server and using its
UNC path to refer to it. This seems to work, but when I open the database
and look at things from the 2000 & 2003 clients, and the server, I see
different paths to the Word reference:

2000 Client path shows the exact UNC path I entered for the reference -
because it has no local file to point to?
2003 Client path shows that it is pointed to the local drive for the
reference - becuase it has a local file to point to?
Server path shows that it is resolving the path (\\server\path becomes
D:\folder\subfolder\file) - because it thinks it's smart?

Anyone know if this is a problem or if there is a better way to do this?

Thanks & Ciao
 
6

'69 Camaro

Hi, Tony.
Anyone know if this is a problem

This is a problem.
I think I can get around this by putting the required .OLB file on the
server and using its UNC path to refer to it.

Did you purchase a license for Word for the server before you copied the
Word Object Library file from another computer that was properly licensed?
No? Then that would be software piracy. One cannot legally copy files from
one computer to another "because we need it on the other computer, too"
without purchasing two software licenses. (NOTE: Some EULA's allow Office
applications to be installed on both a desktop and a laptop, but a file
server doesn't get that luxury.)
or if there is a better way to do this?

Don't use early binding in your VBA code (which requires library
references). Use late binding for the Word tasks. That way, whatever
version of Word is installed on the workstation will be used when executing
the code. If you also need the server's copy of the Access database to use
the Word library, then purchase and install a copy of Word on the server.
But first ask yourself if you really need the server to be importing data
from Word. (Probably not.)

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
R

Rick Brandt

Tony said:
Hi All,

I've got a database into which I have to import data from MS Word. I
initially made a reference to 'Microsoft Word 11.0 Object Library'
for this purpose. I thought everything was fine until I tested on
the server and realized that Word is not installed on the server
(Access is, but only for the purpose performing some nightly
routines).
So, my problem was that I have clients running Office 2000 (10.0),
Office 2003 (11.0), and server with only Access installed. I think I
can get around this by putting the required .OLB file on the server
and using its UNC path to refer to it. This seems to work, but when
I open the database and look at things from the 2000 & 2003 clients,
and the server, I see different paths to the Word reference:

2000 Client path shows the exact UNC path I entered for the reference
- because it has no local file to point to?
2003 Client path shows that it is pointed to the local drive for the
reference - becuase it has a local file to point to?
Server path shows that it is resolving the path (\\server\path becomes
D:\folder\subfolder\file) - because it thinks it's smart?

Anyone know if this is a problem or if there is a better way to do
this?
Thanks & Ciao

Search these groups for the term "Late binding". It lets you do what you
want without setting a reference to Word and (for most all cases) makes your
code version neutral.
 
T

Tony

Gunny,

Thanks for the response and the head's up on copying the .olb to the server.
Never crossed my mind...

The server's not doing the import from Word, it 's importing from a Progress
dB on a nightly basis. But, opening the Access database with the missing
reference would prevent the import from Progress to run correctly. Hence,
my jumping through hoops.

I've never heard of late binding but will definitely check it out.

Thanks again & Ciao,

Tony
 
T

Tony

Rick,

Thanks for the reply. Not familiar with late binding but based on the fact
that both you & '69 Camaro suggested this avenue, definitely something I'll
be looking at.

Ciao,

Tony
 
6

'69 Camaro

Hi, Tony.
But, opening the Access database with the missing reference would prevent
the import from Progress to run correctly.

If you use late binding, you won't need to set a library reference to Word.
If the server has to use the same VBA procedure that uses Word, then use
error handling to catch the inability to create the Word object at run time,
and the server will sail right through the rest of the code.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
T

Tony

Hey Gunny,

Thanks for the follow-up. I did a litle reading on late binding and
although a lot of it is over my head, I think I get the general gist of it.
I put it in place and have checked it across an installs of 2000 (full
Office install), 2003 (Access only install) and it seems to do the trick.
But, is it really that simple? I found examples on Tony Toews' web site
(http://www.granite.ab.ca/access/latebinding.htm) and MS's site
(http://msdn2.microsoft.com/en-us/library/Aa140523(office.10).aspx) and I
expected it to be more complex. I'm not missing something, am I? I don't
always trust Occam's razor....

Thanks again. I really appreciate the help.

Ciao,

Tony
 
6

'69 Camaro

Hi, Tony.
I expected it to be more complex. I'm not missing something, am I?

The code assumes a version of the application has already been installed on
the computer, so that an appropriate object can be instantiated at run time
from the application's object library. You should add error handling code
in the VBA procedure to handle the case where the application hasn't been
installed on the computer.

Other than that, it really is that simple.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
T

Tony

Gunny,

Thanks again. I've got all the pieces in place, including error handling,
and so far, so good. Luckily, the database is for internal use so I have a
bit of control over how it's used, know what the users' installed apps are,
etc. So, I think this will work well. Nice that it's so straightforward.

Again, I appreciate the help.

Tony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top