View Single Post
  #11   Report Post  
Posted to microsoft.public.mac.office.word,microsoft.public.word.mailmerge.fields
Peter Jamieson
 
Posts: n/a
Default fields queries and utter disaster

Does this make sense?

Partly - I agree with the analysis about what the user is trying to
retrieve, but there are at least a couple of key issues:
a. how does the user get any data at all from MySQL into Word on the Mac
platform? Constructing a query or view in the DBMS does not solve that
problem, although it might make it easier to do it without resorting to VBA
or editing a DATABASE field. At the moment the only way I can see is "get
the data from MySQL into a format Word can use as a data source, then use
that". As far as I can see at the moment, that can be done using e.g. Excel
& MS Query, but it isn't clear that it can easily be automated, e.g. there
is no equivalent of ADO to use with Word VBA on Mac, I haven't been able to
get the appropriate Mac Excel VBA "get data directly from an ODBC data
source" sample to work so far, and the MS Query documentation in this
version suggests that it isn't even possible to save a .qry/.dqy file
b. in this case the user needs to enter a value which will restrict the set
of records returned, which means that you have to create a
query/view/procedure to which you can pass a parameter, which means you have
to do slightly more than just use the query/view as a data source (again.
some of this stuff can be done with some types of data source in the Windows
version of Word, but you either have to use the old DDE connection type to
Access (and that option's not available on Mac) or successfully issue a
procedure call with a parameter which is typically not straightforward even
on Windows Word.

The bottom line is, either it's feasible to get this data directly from
Word, or it's probably going to involve a separate manual step.

FWIW, I agree with Doug about databses being the place to manipulate data,
but it kinda depends on what you mean by a "database". To me, the whole
point of a standard such as SQL is that anything can use all its features to
retireve data.I don't see the necessity to do queries as a separate step.

Just my 2c-worth

Peter Jamieson

"CyberTaz" wrote in message
.. .
Hi Doug, et al -

It sounds to me like the 2 tables are related using ID1 as the common
field
(Primary Key of Table1, Foreign Key of Table2). I'm not familiar with
MySQL,
but in Access & others, it would seem to me that a simple query in the
database would provide the record set the user needs, matching records on
the basis of the common field. An inner join would return just the
matching
records & the query should be constructed to return only the 2 required
fields of data (ID1 & ID2) for the matching records.

It seems far simpler to me to do this in the database & use the *query* as
the data source rather than trying to get Word to query the two tables.

What isn't clear (to me) is whether the OP wants to do a *merge*, with the
user choosing which of the found records to include, or whether this doc
is
to be generated for one recipient at a time with the user being prompted
for
an 'ID2' criteria.

Does this make sense?

HTH |:)
Bob Jones
[MVP] Office:Mac



On 4/30/06 2:23 AM, in article , "Doug
Robbins - Word MVP" wrote:

Aside from the issues that have been raised by Peter, does anyone
understand
what the OP means by:

I have a data source that contains two tables - table one has an id1
and some other fields and id1 is the primary key, table2 has as its
primary key id2 but also contains id1 from table1 for linking.

I want my word document to ask for a value for id2. And the select id1
and id2 if and only if table1.id1 equals table2.id1 and table2.id2
contains the value that i was asked for intially.