I am trying to open a Word documents for mail merge and I keep getting
DSN log on from Word. I have created the DSN entry and works fin
outside of the application. This is the line that gives me the problem
WordDoc.MailMerge.OpenDataSource(Name:="", _
Connection:="DSN=$RMPLATINUM$", _
SQLStatement:=SQL, LinkToSource:=False
AddToRecentFiles:=False, _
SubType:=8)
Any clues??
Thank
Peter Jamieson - 04 May 2004 09:31 GMT
A few questions/points:
a. What is the actual data source? Does it require a logon? If so, and the
ODBC driver does not let you store the security info. in the DSN, you will
need to provide it in the Conection string. If you are using SQL Server and
Integrated security you /may/ need to ensure that Integrated Security is
specified in the DSN or the connection string. If you don't want to embed
security info. in the application, want good control over the application
and the user needs to log on, you should consider getting the logon details
yourself (i.e. probably in a .NET Windows form) and constructing the
connection string on-the-fly
b. can we assume you are using a machine (user/system) DSN? Otherwise, you
need the pathname of the .dsn file in Name and FILENAME=that_pathname in
Connection
c. what does the SQL string actually contain (sometimes SQL that executes
correctly outside Word does not execute from within Word, though on the
whole I've experienced this with OLEDB providers rather than ODBC drivers)
d. just in case - which version of Word?

Signature
Peter Jamieson
> I am trying to open a Word documents for mail merge and I keep getting a
> DSN log on from Word. I have created the DSN entry and works fine
[quoted text clipped - 12 lines]
> ------------------------------------------------
> ~~ Message posted from http://www.WordForums.com/