Results 1 to 7 of 7

Thread: References

  1. #1
    New Lounger
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    References

    Problem: I am distributing an Access97 .mde file and cannot tell in advance which version of Word the user has installed. Without a proper match we get broken references. The program is compiled using dao2535.dll and MSWord8.olb in addition to the 2 built-in references to Access and VBA. These are the oldest likely references, and we are assuming that DAO3.51 and Word9 (if present) will be backward compatible.
    With a broken reference to Word, even some of the actions that rely on DAO will fail (particularly those having to do with dates).
    The problems tend to cascade.
    Late binding with Word would remove the need to set a reference to a particular version of Word, but we have about a dozen different places where we have to find and replace Word text with data from the Access file. (Speed is not that essential)
    The small piece of code attached uses the wdFindContinue to step through the document.
    Is there some other way to do the

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: References

    Compiling two versions and then building a sensitive installer could be the easiest approach. How are you distributing the .mde files? Could you get users to open, say, a Word document that could auto-detect its own version and download the correct version to the user?

    <pre>If Application.Version = "8.0" Then 'Word97
    ...
    ElseIf Application.Version = "9.0" Then 'Word2000
    ...
    Else
    MsgBox "Call BobM at once"
    End If
    </pre>

    My installers look something like <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Cat=&Board=vb&Number=15536&page=&v iew=&sb=&vc=1#Post15536>this</A>, though you probably don't need to worry about most of that.

    Plan B could be to use the Windows Installer, but after reading about it a bit, I think it's overkill, and quite time consuming to set up.

    Hope this helps.

  3. #3
    peleg
    Guest

    Re: References

    Um. Somewhat nasty. Began to run into this problem at my previous job but I got downsized before I had to really handle it. But, I think it could be done. I'll give you my outline, but you gotta do the legwork to see if it really works because I never had a chance to actually try it.

    You can look at the reference using the References (container, property,... thingy!) when the program starts up. Then go and see if that file is on their machine. If not, look for the other one, and if it is there, reset the reference. If not, die nicely or do something else sensible.

    One glitch. You may have to use late binding of the Word objects for this to work, otherwise, Access will find the broken references when if fires up.

    Like I said, I haven't tried it, it is a nasty problem. But if you get it to work, Woah! Neat!

    -- Peleg

  4. #4
    New Lounger
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: References

    It hadn't occurred to me, but I guess I could distribute more then one version - each with a different set of references - and then do a Q&A with the user to determine which version to install. I use the ODE Tools Setup Wizard from Microsoft to deploy the database, and I have plenty of room on the CD (the 265 files only take up about 75mb).

    The code to manipulate Word works equally well with Word97 and Word2000 so long as the references are set. Being intensely lazy, I really don't want to re-write the 'find and replace' code in all of the various nooks and crannies of the program. It seems like this would be required if I were to go to late binding.

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: References

    Put your test for broken references in the routine you call at startup. If you reference the VBA Extensibility library, you can use functions from that library to do a lot of ordinary stuff that would otherwise fail with a broken reference, but you'll have to play around with it. In fact, if you open an unprotected version of one of the Access wizards, you'll see that there is no reference to DAO set, only to the extensibility library. That's how they get around the references problem.

    There is an Access 97 references add-in you can download from <A target="_blank" HREF=http://www.mvps.org/access/>The Access Web</A> that might give you some ideas about how to handle broken references.
    Charlotte

  6. #6
    New Lounger
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: References

    A host of blessings upon your head! I had no idea that The Access Web existed and it is obvious that a number of people there 'know their onions'. I retrieved the material you suggested and will give it a try. Thanks again.

  7. #7
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: References

    The only thing to watch out for is versions. Most of the add-ins and wizards posted on the Access Web are for Access 97 and won't work in 2000 without modifications. I did suggest they post an indication of version, but I haven't checked back to see whether they ever did.
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •