473,883 Members | 1,653 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Different Versions of Access on Same Computer

I have a computer with XP on it. I loaded Office 97 first because I
needed Access 97 for some work. I then loaded Office 2000.
Everything seemed to be running fine. But I have come across a few
problems.

1) I have hyperlinks in some tables and when I try to access the
hyperlinks I get an error message "An unexpected error has occurred.

2) I've been trying to do some automation through Access for MS Word
using VBA code. I've been getting an error message "Automation Error,
The server threw an exception".

I'm wondering if this is being caused by some compatibility issues
that I don't know of because caused by having two different versions
of MS Office on my computer.

So I'd greatly appreciate any information on the subject. Thanks.
Nov 12 '05 #1
6 3716
Many people have multiple versions on their workstation. Did you ensure that
the two different versions were installed into different folders?

It would help if you posted the actual code that cause the errors to occur.

Michka has good advice about multiple versions at
http://www.trigeminal.com/usenet/usenet019.asp

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)

"Ecohouse" <vi*******@netz ero.com> wrote in message
news:dd******** *************** ***@posting.goo gle.com...
I have a computer with XP on it. I loaded Office 97 first because I
needed Access 97 for some work. I then loaded Office 2000.
Everything seemed to be running fine. But I have come across a few
problems.

1) I have hyperlinks in some tables and when I try to access the
hyperlinks I get an error message "An unexpected error has occurred.

2) I've been trying to do some automation through Access for MS Word
using VBA code. I've been getting an error message "Automation Error,
The server threw an exception".

I'm wondering if this is being caused by some compatibility issues
that I don't know of because caused by having two different versions
of MS Office on my computer.

So I'd greatly appreciate any information on the subject. Thanks.

Nov 12 '05 #2
Thanks for the help and information. I did install Office 97 and Office
2000 in seperate folders.

Except for the recent problems I have come across I haven't had any
trouble with my code. The problem seems to occur now because I am
trying to access different programs through Access.

Here is one example of code that I'm using. This uses automation to
open Word and create a merge document.

Public Function CreateMergeDoc( UseDDE As Boolean, PrintDoc As Boolean)

Dim WordApp As Word.Applicatio n
Dim WordDoc As Word.Document
Dim strLetter As String
Dim strConnect As String

On Error GoTo CreateMergeDoc_ Error

' Create an instance of Microsoft Word 2000.
Set WordApp = CreateObject("W ord.Application ")

WordApp.Visible = True

' Create a new, empty document.
Set WordDoc = WordApp.Documen ts.Add

With WordDoc.MailMer ge
If UseDDE Then
strConnect = "TABLE Customers"
Else
' Note that on your computer the path
' to Northwind.mdb may be different.

strConnect = "DSN=MS Access " _
& "Database;DBQ=C :\Office2000\Of fice\Samples\No rthwind.mdb;" _
& "FIL=MS Access;"
End If
'============== =============== =============
' This next line causes an error
'============== =============== =============
.OpenDataSource _
Name:="C:\Offic e2000\Office\Sa mples\Northwind .mdb", _
ReadOnly:=True, LinkToSource:=T rue, _
Connection:=str Connect, _
SQLStatement:=" SELECT * FROM [Customers]"

' Define the Merge fields in the document.
With .Fields
.Add Range:=WordApp. Selection.Range , Name:="CompanyN ame"
WordApp.Selecti on.TypeParagrap h
.Add Range:=WordApp. Selection.Range , Name:="Address"
WordApp.Selecti on.TypeParagrap h
.Add Range:=WordApp. Selection.Range , Name:="City"
WordApp.Selecti on.TypeText Text:=", "
.Add Range:=WordApp. Selection.Range , Name:="Region"
WordApp.Selecti on.TypeText Text:=" "
.Add Range:=WordApp. Selection.Range , Name:="PostalCo de"
WordApp.Selecti on.TypeParagrap h
.Add Range:=WordApp. Selection.Range , Name:="Country"
End With
End With

' Define the body of the letter in the merge document.
strLetter = "Thank you for your business during the past year."
With WordApp.Selecti on
.TypeParagraph
.TypeParagraph
.TypeText Text:=strLetter
.TypeParagraph
.TypeParagraph
.TypeText Text:="Sincerel y,"
.TypeParagraph
.TypeParagraph
.TypeText Text:="Northwin d Traders"
End With
With WordDoc.MailMer ge
' Only merge records 1-10 from the table.
.DataSource.Fir stRecord = 1
.DataSource.Las tRecord = 10

' Merge the data to a new document.
.Destination = wdSendToNewDocu ment

' Execute the mail merge.
.Execute

' If user specified to print the document, disable
' background printing, and then print the merged document.
If PrintDoc Then
.Application.Op tions.PrintBack ground = False
.Application.Ac tiveDocument.Pr intOut
End If
End With

' Show the instance of Microsoft Word.
WordApp.Visible = True

CreateMergeDoc_ Exit:
Exit Function

CreateMergeDoc_ Error:
MsgBox Err.Number & vbCrLf & Err.Description
Resume Next

End Function

To run this code you have to check where you have the Northwinds.mdb on
your computer. And type in the following in the intermediate window:
createmergedoc false, False

It returns an error message that says, "Autmation Error, The server
threw an exception". This occurs at the line:

.OpenDataSource _
Name:="C:\Offic e2000\Office\Sa mples\Northwind .mdb", _
ReadOnly:=True, LinkToSource:=T rue, _
Connection:=str Connect, _
SQLStatement:=" SELECT * FROM [Customers]"

The rest of the code runs fine. But I've tried different ways to access
the datasource to run the merge and none of have worked.

Although if I have already created the merge document in Word I can open
and run that. I just can't create it on the fly through code.

I've also run Excel automation with no problem. Although it always
opens Excel 97 and not Excel 2000.

If I'm in a table and I click on a hyperlink field. I get an error that
says, "An unexpected error has occurred.

I know this is a lot of information but I'm hoping that maybe you can
tell me what's going on. I just don't want to find more and more
problems down the line.

Thanks again and in advance for your time and help. It's greatly
appreciated.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3
Not sure I'm going to be offer much assistance, as I don't do mail merges.
You're not actually using DDE, are you? You should probably remove that bit
from the code...

Albert Kallal has sample code for mail merges at
http://www.attcanada.net/~kallal.msn.../msaccess.html You might
compare what you have to his code.

To ensure a particular version of the application, by the way, specify the
version when you instantiate it.

Set WordApp = CreateObject("W ord.Application .8") will get you Word 97, while
Set WordApp = CreateObject("W ord.Application .9") will get you Word 2000.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)

"Bruce Sherman" <vi*******@netz ero.com> wrote in message
news:3f******** *************@n ews.frii.net...
Thanks for the help and information. I did install Office 97 and Office
2000 in seperate folders.

Except for the recent problems I have come across I haven't had any
trouble with my code. The problem seems to occur now because I am
trying to access different programs through Access.

Here is one example of code that I'm using. This uses automation to
open Word and create a merge document.

Public Function CreateMergeDoc( UseDDE As Boolean, PrintDoc As Boolean)

Dim WordApp As Word.Applicatio n
Dim WordDoc As Word.Document
Dim strLetter As String
Dim strConnect As String

On Error GoTo CreateMergeDoc_ Error

' Create an instance of Microsoft Word 2000.
Set WordApp = CreateObject("W ord.Application ")

WordApp.Visible = True

' Create a new, empty document.
Set WordDoc = WordApp.Documen ts.Add

With WordDoc.MailMer ge
If UseDDE Then
strConnect = "TABLE Customers"
Else
' Note that on your computer the path
' to Northwind.mdb may be different.

strConnect = "DSN=MS Access " _
& "Database;DBQ=C :\Office2000\Of fice\Samples\No rthwind.mdb;" _
& "FIL=MS Access;"
End If
'============== =============== =============
' This next line causes an error
'============== =============== =============
.OpenDataSource _
Name:="C:\Offic e2000\Office\Sa mples\Northwind .mdb", _
ReadOnly:=True, LinkToSource:=T rue, _
Connection:=str Connect, _
SQLStatement:=" SELECT * FROM [Customers]"

' Define the Merge fields in the document.
With .Fields
.Add Range:=WordApp. Selection.Range , Name:="CompanyN ame"
WordApp.Selecti on.TypeParagrap h
.Add Range:=WordApp. Selection.Range , Name:="Address"
WordApp.Selecti on.TypeParagrap h
.Add Range:=WordApp. Selection.Range , Name:="City"
WordApp.Selecti on.TypeText Text:=", "
.Add Range:=WordApp. Selection.Range , Name:="Region"
WordApp.Selecti on.TypeText Text:=" "
.Add Range:=WordApp. Selection.Range , Name:="PostalCo de"
WordApp.Selecti on.TypeParagrap h
.Add Range:=WordApp. Selection.Range , Name:="Country"
End With
End With

' Define the body of the letter in the merge document.
strLetter = "Thank you for your business during the past year."
With WordApp.Selecti on
.TypeParagraph
.TypeParagraph
.TypeText Text:=strLetter
.TypeParagraph
.TypeParagraph
.TypeText Text:="Sincerel y,"
.TypeParagraph
.TypeParagraph
.TypeText Text:="Northwin d Traders"
End With
With WordDoc.MailMer ge
' Only merge records 1-10 from the table.
.DataSource.Fir stRecord = 1
.DataSource.Las tRecord = 10

' Merge the data to a new document.
.Destination = wdSendToNewDocu ment

' Execute the mail merge.
.Execute

' If user specified to print the document, disable
' background printing, and then print the merged document.
If PrintDoc Then
.Application.Op tions.PrintBack ground = False
.Application.Ac tiveDocument.Pr intOut
End If
End With

' Show the instance of Microsoft Word.
WordApp.Visible = True

CreateMergeDoc_ Exit:
Exit Function

CreateMergeDoc_ Error:
MsgBox Err.Number & vbCrLf & Err.Description
Resume Next

End Function

To run this code you have to check where you have the Northwinds.mdb on
your computer. And type in the following in the intermediate window:
createmergedoc false, False

It returns an error message that says, "Autmation Error, The server
threw an exception". This occurs at the line:

.OpenDataSource _
Name:="C:\Offic e2000\Office\Sa mples\Northwind .mdb", _
ReadOnly:=True, LinkToSource:=T rue, _
Connection:=str Connect, _
SQLStatement:=" SELECT * FROM [Customers]"

The rest of the code runs fine. But I've tried different ways to access
the datasource to run the merge and none of have worked.

Although if I have already created the merge document in Word I can open
and run that. I just can't create it on the fly through code.

I've also run Excel automation with no problem. Although it always
opens Excel 97 and not Excel 2000.

If I'm in a table and I click on a hyperlink field. I get an error that
says, "An unexpected error has occurred.

I know this is a lot of information but I'm hoping that maybe you can
tell me what's going on. I just don't want to find more and more
problems down the line.

Thanks again and in advance for your time and help. It's greatly
appreciated.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #4
In article <6Q************ *******@news04. bloor.is.net.ca ble.rogers.com>
"Douglas J. Steele" <NOSPAM_djsteel e@NOSPAM_canada .com> wrote:

Many people have multiple versions on their workstation. Did you ensure that
the two different versions were installed into different folders?

It would help if you posted the actual code that cause the errors to occur.

Michka has good advice about multiple versions at
http://www.trigeminal.com/usenet/usenet019.asp

Also, see the several examples at
http://www.nero-online.org/lastmeasure


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)

"Ecohouse" <vi*******@netz ero.com> wrote in message
news:dd******** *************** ***@posting.goo gle.com...
I have a computer with XP on it. I loaded Office 97 first because I
needed Access 97 for some work. I then loaded Office 2000.
Everything seemed to be running fine. But I have come across a few
problems.

1) I have hyperlinks in some tables and when I try to access the
hyperlinks I get an error message "An unexpected error has occurred.

2) I've been trying to do some automation through Access for MS Word
using VBA code. I've been getting an error message "Automation Error,
The server threw an exception".

I'm wondering if this is being caused by some compatibility issues
that I don't know of because caused by having two different versions
of MS Office on my computer.

So I'd greatly appreciate any information on the subject. Thanks.


-=-
This message was posted via two or more anonymous remailing services.








Nov 12 '05 #5
Thanks again for the help. When I use this line of code:
Set WordApp = CreateObject("W ord.Application .8")

It still opens Word 2000.

I also went to the website you suggested and tried that code. It ran
but doesn't really create a merge letter on the fly which is what I'm
trying to do.

So at this pointn I have no idea what to do now. Do you have any other
ideas?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #6
An************* ***@See.Comment .Header
Also, see the several examples at


Do not click on the above mentioned URL.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1533
by: zorro | last post by:
Hello, If I have to test my code on different Netscape versions, can I download and run those versions on the same computer or will it create conflicts? And if I had to test only one version which one should it be - which one has the most common elements to all the versions?
4
2341
by: Dalan | last post by:
After reading and experiencing the phenomenon of installing MS Office 2000 on a system that already has MS Office 97, or for that matter just Access 97 Runtime, I saw the ugliness that ensues. If one elects the standard installation, then Office 2000 deletes a large percentage of the older files. Of course, if one happens to choose Custom installation and elects not to uninstall prior versions, then things are happier. Yes, the archives...
2
1529
by: ken | last post by:
I may need to have front ends configured for Access 2002 and 2000 and have one access 2000 backend. I think it might work? Right now I have access 97 and 2k on my computer and when I tried linking to a table from 2k to 97 it took it. So I'm thinking that if I have Frontends configured for different access versions and 1 backend I might be able to solve my problem. comments? THanks in advance.
9
2446
by: CptDondo | last post by:
I am working on an embedded platform which has a block of battery-backed RAM. I need to store various types of data in this block of memory - for example, bitmapped data for control registers, strings for logging, and structures for data points. I want to use one function to read data from this block and one function to write data, for example: sram_read(OBJECT_IDENTIFIER) would return a pointer to the appriate object and
2
1220
by: Eugene | last post by:
Hello all, I'm stuck here (nothing new in this world). I have a program, that runs fine on my computer (where I actually developing C# Windows app), but appears to be buggy on another computer. Same Windows versions, same .NET Framework... Is there something I am overlooking ? Below I have a function code, which works on my computer, but does not on another:
17
5115
by: romixnews | last post by:
Hi, I'm facing the problem of analyzing a memory allocation dynamic and object creation dynamics of a very big C++ application with a goal of optimizing its performance and eventually also identifying memory leaks. The application in question is the Mozilla Web Browser. I also have had similar tasks before in the compiler construction area. And it is easy to come up with many more examples, where such kind of statistics can be very...
37
3764
by: Allen Browne | last post by:
If you develop for others, you probably have multiple versions of Access installed so you can edit and create MDEs for clients in different versions. This works fine under Windows XP, even with Access 2007 installed. It does *not* work under Windows Vista Ultimate. After running Access 2007, when you open an earlier version of Access, no code works, because the references are fouled up. And Access 97 does not work at all. Access should...
3
2975
by: Chet | last post by:
I am writing an application that utilizes a reference to Microsoft Outlook. (Added a reference to the MS Outlook COM interface to my project). I then write code such as: dim olApp as new Outlook.Applicaiton dim olNamespace as OutlOok.Namespace = olApp..... I am deploying my application via the "publish" feature that makes it downloadable and installable via the web.
2
2133
by: =?Utf-8?B?UGV0ZQ==?= | last post by:
I have a .Net application (VB, VS 2005, FX 2) running in more than one country. As part of the product registration process, some information on the computer is collected and sent to a web service; this includes the operating system which is obtained using the My.Computer.Info.OSFullName function. For some machines we get "Microsoft Windows XP Professional" and for others "Microsoft Windows NT 5.1.2600 Service Pack 2". I understand these...
0
9940
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9792
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10847
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10415
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9574
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5797
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4612
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4220
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3232
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.