P
Pius Graber
I'm using the following Code in MSAccess 2002:
WordApp.ActiveDocument.MailMerge.OpenDataSource Name:= _
"J:\qWord.odc" _
, ConfirmConversions:=False, ReadOnly:=False,
LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="",
PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="",
Revert:=False, _
Format:=wdOpenFormatAuto, Connection:="",
SQLStatement:="SELECT * FROM [qWord999]", SQLStatement1 _
:="", SubType:=wdMergeSubTypeOther
with the following part in the qWord.odc (to SQL Server)
<odc:CommandText>"MyDatabase"."dbo"."qWordTemplate"</odc:CommandText>
This works fine.
When I change the SQL-Statement to
"SELECT * FROM [qWord999] ORDER BY P_Name"
I get an error "Unable to Open Datasouce"
Can someone help please?
Thank you
WordApp.ActiveDocument.MailMerge.OpenDataSource Name:= _
"J:\qWord.odc" _
, ConfirmConversions:=False, ReadOnly:=False,
LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="",
PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="",
Revert:=False, _
Format:=wdOpenFormatAuto, Connection:="",
SQLStatement:="SELECT * FROM [qWord999]", SQLStatement1 _
:="", SubType:=wdMergeSubTypeOther
with the following part in the qWord.odc (to SQL Server)
<odc:CommandText>"MyDatabase"."dbo"."qWordTemplate"</odc:CommandText>
This works fine.
When I change the SQL-Statement to
"SELECT * FROM [qWord999] ORDER BY P_Name"
I get an error "Unable to Open Datasouce"
Can someone help please?
Thank you