I don't have an AS400 to experiment with here, but precisely what happens
when you connect using MS Query depends on how you are using it - if you are
"inserting a database" and opting not to insert it as a field, generally
speaking, things will work. If you are inserting the data as a DATABASE
field, or using it as a data source, then the problem is that MS Query might
be able to get the data, but then Word basically has to be able to get it
again, and a number of things may prevent it from doing so, e.g.
a. MS Query may return a DSN-less ODBC Connection string (i.e. starting
something like "DRIVER=" rather than "DSN=") which Word cannot use. Word
really only works with connection strings that specify a machine (system or
user) or file DSN.
b. the SQL is too long (either 256 or 512 bytes is probably too long).
c. the SQL MS Query generates is not valid for the data source (I have
heard that there is, or was, a specific issue with AS 400 SQL to do with the
quoting of multi-part names (e.g. where MS Query would use SELECT x FROM
'a'.b'.'c' and AS400 required SELECT x FROM 'a.b.c'. Or vice versa..
d. the ODBC DSN used to connect does not store the necessary authentication
information, and MS Query does not return the full connection string, with
authenticaiton info, to Word.
e. The connection string returned by MS Query is longer than 255 bytes and
is truncated in a way that makes it fail.
In the case of (b) or (c), you might be able to fix using the SQL button in
MS Query to edit the SQL source to reduce its length or correct its syntax
(if you can work out what is required).
In the case of (d) or (e) you /may/ be able to fix the problem by creating a
suitable DSN that stores the authentication information. Whether that is
possible depends on the ODBC driver (for example, off the top of my head I
don't think the SQL Server driver lets you save the authentication info,
although it looks as if it does).
Otherwise, what you probably need to do is create
a. a suitable ODBC DSN
b. a VBA macro containing an OpenDataSource method call with a Connection
string that works, and a SQLStatement (and if necessary, SQLStatement1)
containing a SQL string that is accepted by AS400. Typically you ought at
least to be able to use MS Query to give you a starting point chunk of SQL
that you could adapt for such a call.
Pity about all this techie stuff but I don't think it's easily avoided.
Another way you /might/ be able to make things easier would be to use an
intermediate database that knows how to connect to AS400 and which is a
better-behaved Word data source. Could be Access or even SQL Server, but
beyond that I can't say.