Word seems to be able to set up and use "DSN-less" connections (e.g. your
option (b) ) in some (limited) circumstances.
However, I have never managed to set up a DSN-less connection using the \c
parameter in the DATABASE field or the OpenDataSource method in VBA.
Although I like to think I try all the possibilities,
a. there is not much documentation in this area. I have never seen official
documentation that says that DSN-less connections are not supported by Word.
b. I cannot be sure it is impossible.
So if you ever manage to get it to work, please let us know how!
If it is more useful to you, you should be able to specify a file DSN using
FILEDSN=<the pathname of the file DSN>. However, that may start failing in
Word 2002 and later.
--
Peter Jamieson - Word MVP
Word MVP web site
http://word.mvps.org/
Bao Le said:
Hi Peter,
I've been trying to do a WORD merge with the Oracle table in the following way using the DATABASE field:
a) Using system DSN:
{ DATABASE \c "DSN=gard; UID=userid;PWD=password" \s "SELECT
PLN_ORGN_DSCRPTN FROM AMS_REF.PLAN_ORIGIN" \* CharFormat }
b) without using DSN
{ DATABASE \c "DRIVER={Microsoft ODBC for
Oracle};UID=userid;PWD=password;SERVER=gard;" \s "SELECT PLN_ORGN_DSCRPTN
FROM AMS_REF.PLAN_ORIGIN" \* CharFormat }
When I ran the merge using option (a), it worked fine merging data
directly to the Oracle table. However when I ran option (b) I got a "field
calculation error occurred in record 1". I'm not sure if I'm missing
anything in the connection string?