G
Gerhard Kiessling
Hello @ll,
I'm trying to directly connect an MS Word MailMerge object to an SQL server
table
(Word XP German)
code e,g,
ActiveDocument.MailMerge.OpenDataSource _
Name:="", _
Connection:="Provider=SQLOLEDB.1;Persist Security
Info=False;UserID=[UID];Initial Catalog=[database];Data Source=[server]", _
SQLStatement:="SELECT * FROM ""table"""
When executing OpenDataSource Word always opens a file dialog "select data
source"
If I select a (former created for test purposes) ODC-file, the command is
passed.
If I cancel the dialog, the code runs against runtime error 4198 'command
failed'.
But I don't like to have the user select the data source, I would like to
connect per only (so the user does not know - and is not interested - where
the data are from)
Can anyone help ?
How must the parameter 'Name' be filled, so that there is no file data
source required ?
Appendix : connection string and sql command are prooved and are working
properly, so this is not the reason ...
Thanks for any help !
I'm trying to directly connect an MS Word MailMerge object to an SQL server
table
(Word XP German)
code e,g,
ActiveDocument.MailMerge.OpenDataSource _
Name:="", _
Connection:="Provider=SQLOLEDB.1;Persist Security
Info=False;UserID=[UID];Initial Catalog=[database];Data Source=[server]", _
SQLStatement:="SELECT * FROM ""table"""
When executing OpenDataSource Word always opens a file dialog "select data
source"
If I select a (former created for test purposes) ODC-file, the command is
passed.
If I cancel the dialog, the code runs against runtime error 4198 'command
failed'.
But I don't like to have the user select the data source, I would like to
connect per only (so the user does not know - and is not interested - where
the data are from)
Can anyone help ?
How must the parameter 'Name' be filled, so that there is no file data
source required ?
Appendix : connection string and sql command are prooved and are working
properly, so this is not the reason ...
Thanks for any help !