retrieve a empty list when using an Access query

C

ChrisK

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?
 
P

Peter Jamieson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top