Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / August 2004

Tip: Looking for answers? Try searching our database.

Can't connect to OpenDataSource

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marty - 24 Aug 2004 16:38 GMT
Hi-

I have 2 documents in Word97, each has a similar macro.
The 1st works fine, the second gives a connection error.
(MS Word error 1826: Word was unable to open data source.)

In the MailMergeOpenDataSource for the 1st, which works,
I have:

WordBasic.MailMergeOpenDataSource Name:="",
ConfirmConversions:=0, ReadOnly:=0, LinkToSource:=0,
AddToMru:=0, PasswordDoc:="", PasswordDot:="", Revert:=0,
WritePasswordDoc:="", WritePasswordDot:="",
Connection:="DSN=GAVURAH;UID=sa;PWD=;APP=Microsoft
Query;WSID=SHIVAINDRA;LANGUAGE=us_english;DATABASE=lp_pate
nts", SQLStatement:="execute splp_lppci " & Chr(34) &
OrderLetterNumber & Chr(34), SQLStatement1:=""

In the MailMergeOpenDataSource for the 2nd, which gives
an error, I have:

WordBasic.MailMergeOpenDataSource Name:="",
ConfirmConversions:=0, ReadOnly:=0, LinkToSource:=0,
AddToMru:=0, PasswordDoc:="", PasswordDot:="", Revert:=0,
WritePasswordDoc:="", WritePasswordDot:="",
Connection:="DSN=GAVURAH;UID=sa;PWD=;APP=Microsoft
Query;WSID=SHIVAINDRA;LANGUAGE=us_english;DATABASE=lp_pate
nts", SQLStatement:="execute splp_lppciUS " & Chr(34) &
OrderLetterNumber & Chr(34), SQLStatement1:=""

The names of the 2 stored proceedures are: splp_lppci and
splp_lppciUS. They run different queries.

The only difference in the MailMerge statements above is
the "US" in the name of the stored proceedure. (If I
remove the "US", then it doesn't give any error, but the
data are wrong, as this is not the stored proceedure that
I want to run.)

It doesn't appear that the statements are wrong, since if
I change the name of the stored proceedure, it connects.
The stored proceedures are good (I think) since they work
fine in Query Analyzer. The one called splp_lppci doesn't
cause a connection error, and the splp_lppciUS stored
proceedure does.

Am I missing an obvious thing here? Any ideas?

Thanks in advance for looking at this.
- 24 Aug 2004 16:55 GMT
It always happens. I spend 2-3 days on a problem and
can't figure it out. So I post it. 10 minutes later I see
the answer.  

Thanks for taking the time to look at this.

Much appreciated

-Marty

>-----Original Message-----
>Hi-
[quoted text clipped - 48 lines]
>
>.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.