SQL Parsing to Complex 
Author Message
 SQL Parsing to Complex

I'm having problems doing a mail merge between MS Word 97 and Access 97.
In my Word document I want to merge data from 2 different tables.
Below is the SQL that Access generated when I made a query combining the
two tables.

 SELECT tblPatient.*, tblPatientConfidential.*
 FROM tblPatient INNER JOIN tblPatientConfidential ON
 tblPatient.PatientID = tblPatientConfidential.PatientID;

In Access the query works fine.  But when I try to use the same query to
do a mail merge, I get the following error: "The SQL string associated
with the mail merge data source mya_be.mdb is too complex for windows to
parse.  Do you want to edit the SQL string directly?"

I previously submitted this to comp.databases.ms-access but didn't get
any replys.  Any idea why this happening and what I can do to get it to
work? Thanks.

Daniel Ginsberg, MD

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Sun, 16 Jun 2002 03:00:00 GMT  
 SQL Parsing to Complex
Quote:
> I'm having problems doing a mail merge between MS Word 97 and Access 97.
> In my Word document I want to merge data from 2 different tables.
> Below is the SQL that Access generated when I made a query combining the
> two tables.

How about saving this query in Access and merging to it, rather than using
an SQL statement in Word's relatively weak data-linking? There's no
problem using a query as the data source in either a DDE or ODBC link. For
the latter, click "Options" in the Select Table dialog box, activate
"Views", and the query will be available in the list.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)



Sun, 16 Jun 2002 03:00:00 GMT  
 SQL Parsing to Complex
Actually this is what I did.  I never wrote a SQL statement, I just
referenced the Access query.  The SQL I referenced was obtained in
Access by looking at the SQL View in the Design View of the query.


Quote:

> > I'm having problems doing a mail merge between MS Word 97 and

Access 97. In my Word document I want to merge data from 2 different
tables. Below is the SQL that Access generated when I made a query
combining the two tables.
Quote:

> >How about saving this query in Access and merging to it, rather than

using an SQL statement in Word's relatively weak data-linking? There's
no problem using a query as the data source in either a DDE or ODBC
link. For the latter, click "Options" in the Select Table dialog box,
activate "Views", and the query will be available in the list.

Quote:

> >Cindy Meister
> >INTER-Solutions, Switzerland
> >http://homepage.swissonline.ch/cindymeister
> http://go.compuserve.com/MSOfficeForum

> This reply is posted in the Newsgroup; please post any follow
question or
> reply in the newsgroup and not by e-mail :-)

Sent via Deja.com http://www.deja.com/
Before you buy.


Mon, 17 Jun 2002 03:00:00 GMT  
 SQL Parsing to Complex
Quote:
> Actually this is what I did.  I never wrote a SQL statement, I just
> referenced the Access query.  The SQL I referenced was obtained in
> Access by looking at the SQL View in the Design View of the query.

Hmmm. OK

Quote:
> SELECT tblPatient.*, tblPatientConfidential.*
>  FROM tblPatient INNER JOIN tblPatientConfidential ON
>  tblPatient.PatientID = tblPatientConfidential.PatientID;

If I read this correctly, you're selecting all the fields rom these two
tables. This could be what's causing the problem for Word. Do you need
ALL the fields? Try dragging each field that you really need into the
QBE grid, see if that helps.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)



Tue, 18 Jun 2002 03:00:00 GMT  
 SQL Parsing to Complex
For anyone interested, it's easy to reproduce this error.  In Access 97
start a new database using the Workout template and have Access enter
the sample data.  Make a select query by adding the Workout History
table and the Workouts table.  From the Workout History table add the
Workout Date field.  From the Workouts table add the WorkoutDescription
field. Running the query should give you a table with 6 records showing
the Workout Date and a description of the workout.

Now open up a blank Microsoft Word document.  Go to the Mail Merge menu
and click on the Creat Main Document.  Then click on Get Data and
select the Workout database you created. Close out the Mail Merge menu
and insert the 2 mail merge fields ?WorkoutDate? ?WorkoutDescription?.

If you click the query options, you'll get an error message.  I hope
someone can figure out why.

Daniel Ginsberg, MD

Sent via Deja.com http://www.deja.com/
Before you buy.



Tue, 25 Jun 2002 03:00:00 GMT  
 SQL Parsing to Complex
I'm not familiar with this database template, but I have a question:

What field type is WorkoutDescription? Is it a MEMO field?

Quote:
> From the Workouts table add the WorkoutDescription
> field.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)



Sun, 30 Jun 2002 03:00:00 GMT  
 SQL Parsing to Complex
It is a TEXT field.  The Workout template came with Access97.


Quote:

> I'm not familiar with this database template, but I have a question:

> What field type is WorkoutDescription? Is it a MEMO field?

Sent via Deja.com http://www.deja.com/
Before you buy.


Tue, 02 Jul 2002 03:00:00 GMT  
 SQL Parsing to Complex
Quote:
> It is a TEXT field.  The Workout template came with Access97.

A thought occurs to me: Have you applied any of the Service Packs (SR-1
or SR-2) to Office 97? The original release was awfully buggy, and I
seem to recall seeing problems with "complex queries" that disappeared
after SR-1.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)



Wed, 03 Jul 2002 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. .NET SQL Parse Method for Verifying SQL and Stored Procedures that are user defined

2. Complex String Manipulation - Well Complex For Me Anyway

3. SQL's with complex queries

4. SQL declaration too complex?

5. complex SQL query

6. Complex SQL Query...HELP!

7. Complex Text to SQL

8. VB 4.0, ANSI SQL '89, complex queries?

9. SQL declaration too complex?

10. Complex SQL Statement

11. Help with complex SQL statement

12. SQL too complex

 

 
Powered by phpBB® Forum Software