Group:  Microsoft Word ยป microsoft.public.word.mailmerge.fields
Thread: retrieve a empty list when using an Access query

Geek News

retrieve a empty list when using an Access query
ChrisK 11/23/2008 9:21:01 AM
Im trying to merge an Access 2003 query result into a Word 2003 doc. If I run
the query in Access i produce a list of results. When I attach the query to
the Word doc the imported table is empty?
Re: retrieve a empty list when using an Access query
"Peter Jamieson" <pjj[ at ]KillmapSpjjnet.demon.co.uk> 11/23/2008 5:10:24 PM
You are probably using wildcard characters in a LIKE clause in the Query.
Access only recognises the Jet ones (* and ?) unless the database has been
modified to recognise the ANSI ones (% and _). OLE DB, which Word 203 uses
by default to get the data, only recognises the ANSI ones. If that is the
problem, your options include:
a. connect using DDE, which uses Access to execute the query (check Word
Tools->Options->General->COnfirm conversions at open, then go through the
connection process again and choose the DDE option when it is offered.
b. modify the Access database so the ANSI wildcards are recognised (it's an
option somewhere in access). It's difficult to recommend this because the
change may affect a lot of existing software and you will probably have to
change all the queries.
c. have two versions of each query that uses wildcards - one that uses the
Jet wildcards, the other that uses the ANSI ones, and pick the appropriate
query
d. if the query is shorter than either 255 or 511 characters long (a
limitation in Word), issue the ANSI version of the query in a Word VBA
OpenDataSource call.

Peter Jamieson

"ChrisK" <ChrisK[ at ]discussions.microsoft.com> wrote in message
news:F8207105-4D35-48B8-94F4-06124454A83D[ at ]microsoft.com...
[Quoted Text]
> Im trying to merge an Access 2003 query result into a Word 2003 doc. If I
> run
> the query in Access i produce a list of results. When I attach the query
> to
> the Word doc the imported table is empty?

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net