M
Marty
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.
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.