If you're seeing the data link properties, you're probably actually
connecting via OLE DB, using the OLE DB provider for ODBC data sources, and
in my experience Word doesn't usually work with that very well.
In this case it's probably going to be easier doing the connection using
VBA, in which case you need something like the following if you're using a
system or user DSN:
Sub Connect2mySQL()
ActiveDocument.MailMerge.OpenDataSource _
Name:="", _
Connection:="DSN=your mySQL ODBC dsn name;PWD=your mySQL password;", _
SQLStatement:="SELECT * FROM mytable", _
SubType:=wdMergeSubTypeWord2000
End Sub
or like the following if you're using a file DSN:
Sub Connect2mySQL()
ActiveDocument.MailMerge.OpenDataSource _
Name:="the full path name to your .dsn file", _
Connection:="FILEDSN=the full path name to your .dsn file;PWD=your mySQL
password;", _
SQLStatement:="SELECT * FROM mytable", _
SubType:=wdMergeSubTypeWord2000
End Sub
You might also need the UID= parameter (mySQL user ID) if it isn't in your
DSN.
You should only need to run the macro once to set up the data source - after
you've saved the document, the connection should be re-made on re-open
(forgetting about the SQL prompt).
If you're not familiar with how to run VBA macros, see
http://word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm
Peter Jamieson
> Hi
>
[quoted text clipped - 9 lines]
> Does anybody know of a way around this? I have tried the same set up using
> Open Office and that seemed to work.