Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 97 on XP only works if reference changed and then changed back?

Status
Not open for further replies.

jeisch

MIS
May 30, 2003
23
0
0
US
I have an Access97 application that is running in several different environments, 95, NT, XP. Everything works fine except when we distribute it to the XP machine. On the XP set, we get an error in a couple of queries where it can’t find certain functions. If we go into references and change any reference, and then change the reference back, the query will then work. I checked all the referenced files on each workstation, and they are the same size, with the same date and time. Is there any way to simulate a change to the references in the code? Any other suggestions would be greatly appreciated.
 
Is it only one XP machine you're experiencing problems with, or multiple machines?

Which functions are missing?

Ed Metcalfe.

Please do not feed the trolls.....
 
It only happens when going from the windows 95 workstation to the XP set. I think it may have something to do with the references to Word and Outlook. When running on the XP machine, it automatically changes the references from Word and Outlook 8.0 to Word and Outlook 11.0. The XP sets only have the earlier verion of Access, not Outlook and Word. If I remove those references, and then move it over to XP, the query works fine, but I need those references for other parts of the application.

I’m not really sure what is causing the problem in the query, I get the following message:

"Function isn’t available in expressions in query expression."

Some of the features used in this query are: IIF, Format, Len, Mid

It seems to me that when it is changing the Outlook and Word references, it is somehow messing up one of the other references. As soon as we go into references and change anything, the query then works fine again.
 
I have found that when there is an invalid reference to any library, you often get misleading errors regarding the regular Access functions.

I'm not sure if I understand you right, is there no installation of Outlook and Word on the XP machines, or just a different version?

If it's a different version, you may have to check your references on the first XP machine you install to, and if you make any changes, then use that copy for the other XP machines. Sounds like your already doing that, however.
 
There is a different version of Word and Outlook on the XP machines. When the apllication is opened, it goes out and gets the newer references for those products automatically, and those functions work fine. Keeping multiple versions of the application is what we are trying to avoid. And if we update the application on the XP machine, and then move it the the 95 machine, we get errors because the newer references for Word and Outlook don't exist on the WIN 95 machines.
 
I agree with Joe's first paragraph completely. Invalid/missing references can cause unexpected error messages in bog standard VBA functions and expressions.

It's not an ideal solution but I think I'd be tempted to build a separate frontend app for each OS. Your installer could recognise which OS the user has and select the appropriate files accordingly.

It may be something completely out of your control, but why on Earth are you still using Win95?!

Ed Metcalfe.

Please do not feed the trolls.....
 
The only way I can think of to not maintain separate versions is to use CreateObject instead of referencing the Word and Outlook libraries. But late-binding is less efficient.

There is probably a way you can set the references dynamically with code, but I don't know off the top of my head where to start looking.

I think the way I would do it is have the different versions I need on my development machine. When you release a new version, make one referencing the older library, then go back and make another referencing the new version. I know it's a pain.

This is why many companies enforce standardization of hardware and software for all their employees - so one version will work for everybody.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top