Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Richard Richard is offline
external usenet poster
 
Posts: 150
Default Merging from two sources

Despite all that I have read on here I know this is possible - I have
succesfully done so in the past and the article "Mail Merge: Part II" located
at: http://msdn2.microsoft.com/en-us/lib...ffice.10).aspx
explains how - but the article is for Word 2000, and I am either missing
something, or the process is different for 2003.

I have two tables, the first contains the names and email addresses of
contacts. The second contains details about the contacts - one to many
relationship. I am attempting to use mail merge for the information from the
first table, and the DATABASE FIELD command to insert a table containing the
information in the second table, everything works - except when I try to
filter the second one to only show the records relevant to the officer - my
text is below what am I missing?


{DATABASE \d "C:\\Documents and Settings\\p7psri\\Desktop\\Book1.xls" \c
"Provider=Microsoft.Jet.OLEDB.4.0;Password=\"\";Us er ID=Admin;Data
Source=C:\\Documents and
Settings\\p7psri\\Desktop\\Book1.xls;Mode=Read;Ext ended
Properties=\"HDR=YES;IMEX=1;\";Jet OLEDB:System database=\"\";Jet
OLEDB:Registry Path=\"\";Jet OLEDBatabase Password=\"\";Jet OLEDB:Engine
Type=35;Jet OLEDBatabase Locking Mode=0;Jet OLEDB:Global Partial Bulk
Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database
Password=\"\";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt
Database=False;Jet OLEDBon't Copy Locale on Compact=False;Jet OLEDB:Compact
Without Replica Repair=False;Jet OLEDB:SFP=False" \s "SELECT `entryid`,
`number`, `item` FROM `Sheet2$` WHERE ((`number` = '{MERGEFIELD number}'))"
\h }

This has really stumped me especially since I know that this is possible any
help would be greatly appreceiated.

Thank you

  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Merging from two sources

Try the following:
a. ensure that { MERGEFIELD number } is a field, i.e that the {} are the
special field braces you can insert using ctrl-F9
b. if "number" is actually numeric, try losing the quaotes around {
MERGEFIELD number }
c. add a table alias and qualify all the filed names (you shouldn't have to
do this but for some reason Word+Jet OLE DB seem to insist on it).

e.g.

{DATABASE \d "C:\\Documents and Settings\\p7psri\\Desktop\\Book1.xls" \c
"Provider=Microsoft.Jet.OLEDB.4.0;Password=\"\";Us er ID=Admin;Data
Source=C:\\Documents and
Settings\\p7psri\\Desktop\\Book1.xls;Mode=Read;Ext ended
Properties=\"HDR=YES;IMEX=1;\";Jet OLEDB:System database=\"\";Jet
OLEDB:Registry Path=\"\";Jet OLEDBatabase Password=\"\";Jet OLEDB:Engine
Type=35;Jet OLEDBatabase Locking Mode=0;Jet OLEDB:Global Partial Bulk
Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database
Password=\"\";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt
Database=False;Jet OLEDBon't Copy Locale on Compact=False;Jet
OLEDB:Compact
Without Replica Repair=False;Jet OLEDB:SFP=False" \s "SELECT s.entryid,
s.number, s.item FROM `Sheet2$` [s] WHERE ((s.number = '{MERGEFIELD
number}'))"
\h }

or

{DATABASE \d "C:\\Documents and Settings\\p7psri\\Desktop\\Book1.xls" \c
"Provider=Microsoft.Jet.OLEDB.4.0;Password=\"\";Us er ID=Admin;Data
Source=C:\\Documents and
Settings\\p7psri\\Desktop\\Book1.xls;Mode=Read;Ext ended
Properties=\"HDR=YES;IMEX=1;\";Jet OLEDB:System database=\"\";Jet
OLEDB:Registry Path=\"\";Jet OLEDBatabase Password=\"\";Jet OLEDB:Engine
Type=35;Jet OLEDBatabase Locking Mode=0;Jet OLEDB:Global Partial Bulk
Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database
Password=\"\";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt
Database=False;Jet OLEDBon't Copy Locale on Compact=False;Jet
OLEDB:Compact
Without Replica Repair=False;Jet OLEDB:SFP=False" \s "SELECT s.entryid,
s.number, s.item FROM `Sheet2$` [s] WHERE ((s.number = {MERGEFIELD
number}))"
\h }

You can probably simplify that to something more like

{DATABASE \d "C:\\Documents and Settings\\p7psri\\Desktop\\Book1.xls" \c
"Provider=Microsoft.Jet.OLEDB.4.0;Password=\"\";Da ta
Source=C:\\Documents and
Settings\\p7psri\\Desktop\\Book1.xls;Mode=Read;Ext ended
Properties=\"HDR=YES;IMEX=1;\";Jet OLEDB:Engine
Type=35;" \s "SELECT s.entryid,
s.number, s.item FROM `Sheet2$` [s] WHERE (s.number = {MERGEFIELD number})"
\h }

and probably even more than that.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"Richard" wrote in message
...
Despite all that I have read on here I know this is possible - I have
succesfully done so in the past and the article "Mail Merge: Part II"
located
at: http://msdn2.microsoft.com/en-us/lib...ffice.10).aspx
explains how - but the article is for Word 2000, and I am either missing
something, or the process is different for 2003.

I have two tables, the first contains the names and email addresses of
contacts. The second contains details about the contacts - one to many
relationship. I am attempting to use mail merge for the information from
the
first table, and the DATABASE FIELD command to insert a table containing
the
information in the second table, everything works - except when I try to
filter the second one to only show the records relevant to the officer -
my
text is below what am I missing?


{DATABASE \d "C:\\Documents and Settings\\p7psri\\Desktop\\Book1.xls" \c
"Provider=Microsoft.Jet.OLEDB.4.0;Password=\"\";Us er ID=Admin;Data
Source=C:\\Documents and
Settings\\p7psri\\Desktop\\Book1.xls;Mode=Read;Ext ended
Properties=\"HDR=YES;IMEX=1;\";Jet OLEDB:System database=\"\";Jet
OLEDB:Registry Path=\"\";Jet OLEDBatabase Password=\"\";Jet OLEDB:Engine
Type=35;Jet OLEDBatabase Locking Mode=0;Jet OLEDB:Global Partial Bulk
Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database
Password=\"\";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt
Database=False;Jet OLEDBon't Copy Locale on Compact=False;Jet
OLEDB:Compact
Without Replica Repair=False;Jet OLEDB:SFP=False" \s "SELECT `entryid`,
`number`, `item` FROM `Sheet2$` WHERE ((`number` = '{MERGEFIELD
number}'))"
\h }

This has really stumped me especially since I know that this is possible
any
help would be greatly appreceiated.

Thank you


  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Richard Richard is offline
external usenet poster
 
Posts: 150
Default Merging from two sources

Thank you - the CTRL - F9 was a great help - I mucked around with it and got
the syntax to work.



"Peter Jamieson" wrote:

Try the following:
a. ensure that { MERGEFIELD number } is a field, i.e that the {} are the
special field braces you can insert using ctrl-F9
b. if "number" is actually numeric, try losing the quaotes around {
MERGEFIELD number }
c. add a table alias and qualify all the filed names (you shouldn't have to
do this but for some reason Word+Jet OLE DB seem to insist on it).

e.g.

{DATABASE \d "C:\\Documents and Settings\\p7psri\\Desktop\\Book1.xls" \c
"Provider=Microsoft.Jet.OLEDB.4.0;Password=\"\";Us er ID=Admin;Data
Source=C:\\Documents and
Settings\\p7psri\\Desktop\\Book1.xls;Mode=Read;Ext ended
Properties=\"HDR=YES;IMEX=1;\";Jet OLEDB:System database=\"\";Jet
OLEDB:Registry Path=\"\";Jet OLEDBatabase Password=\"\";Jet OLEDB:Engine
Type=35;Jet OLEDBatabase Locking Mode=0;Jet OLEDB:Global Partial Bulk
Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database
Password=\"\";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt
Database=False;Jet OLEDBon't Copy Locale on Compact=False;Jet
OLEDB:Compact
Without Replica Repair=False;Jet OLEDB:SFP=False" \s "SELECT s.entryid,
s.number, s.item FROM `Sheet2$` [s] WHERE ((s.number = '{MERGEFIELD
number}'))"
\h }

or

{DATABASE \d "C:\\Documents and Settings\\p7psri\\Desktop\\Book1.xls" \c
"Provider=Microsoft.Jet.OLEDB.4.0;Password=\"\";Us er ID=Admin;Data
Source=C:\\Documents and
Settings\\p7psri\\Desktop\\Book1.xls;Mode=Read;Ext ended
Properties=\"HDR=YES;IMEX=1;\";Jet OLEDB:System database=\"\";Jet
OLEDB:Registry Path=\"\";Jet OLEDBatabase Password=\"\";Jet OLEDB:Engine
Type=35;Jet OLEDBatabase Locking Mode=0;Jet OLEDB:Global Partial Bulk
Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database
Password=\"\";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt
Database=False;Jet OLEDBon't Copy Locale on Compact=False;Jet
OLEDB:Compact
Without Replica Repair=False;Jet OLEDB:SFP=False" \s "SELECT s.entryid,
s.number, s.item FROM `Sheet2$` [s] WHERE ((s.number = {MERGEFIELD
number}))"
\h }

You can probably simplify that to something more like

{DATABASE \d "C:\\Documents and Settings\\p7psri\\Desktop\\Book1.xls" \c
"Provider=Microsoft.Jet.OLEDB.4.0;Password=\"\";Da ta
Source=C:\\Documents and
Settings\\p7psri\\Desktop\\Book1.xls;Mode=Read;Ext ended
Properties=\"HDR=YES;IMEX=1;\";Jet OLEDB:Engine
Type=35;" \s "SELECT s.entryid,
s.number, s.item FROM `Sheet2$` [s] WHERE (s.number = {MERGEFIELD number})"
\h }

and probably even more than that.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"Richard" wrote in message
...
Despite all that I have read on here I know this is possible - I have
succesfully done so in the past and the article "Mail Merge: Part II"
located
at: http://msdn2.microsoft.com/en-us/lib...ffice.10).aspx
explains how - but the article is for Word 2000, and I am either missing
something, or the process is different for 2003.

I have two tables, the first contains the names and email addresses of
contacts. The second contains details about the contacts - one to many
relationship. I am attempting to use mail merge for the information from
the
first table, and the DATABASE FIELD command to insert a table containing
the
information in the second table, everything works - except when I try to
filter the second one to only show the records relevant to the officer -
my
text is below what am I missing?


{DATABASE \d "C:\\Documents and Settings\\p7psri\\Desktop\\Book1.xls" \c
"Provider=Microsoft.Jet.OLEDB.4.0;Password=\"\";Us er ID=Admin;Data
Source=C:\\Documents and
Settings\\p7psri\\Desktop\\Book1.xls;Mode=Read;Ext ended
Properties=\"HDR=YES;IMEX=1;\";Jet OLEDB:System database=\"\";Jet
OLEDB:Registry Path=\"\";Jet OLEDBatabase Password=\"\";Jet OLEDB:Engine
Type=35;Jet OLEDBatabase Locking Mode=0;Jet OLEDB:Global Partial Bulk
Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database
Password=\"\";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt
Database=False;Jet OLEDBon't Copy Locale on Compact=False;Jet
OLEDB:Compact
Without Replica Repair=False;Jet OLEDB:SFP=False" \s "SELECT `entryid`,
`number`, `item` FROM `Sheet2$` WHERE ((`number` = '{MERGEFIELD
number}'))"
\h }

This has really stumped me especially since I know that this is possible
any
help would be greatly appreceiated.

Thank you



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
My Data Sources Inobugs Microsoft Word Help 0 August 7th 07 12:24 AM
manage sources Katie Microsoft Word Help 2 February 6th 07 01:35 AM
data sources Alex New Users 2 September 21st 06 06:24 AM
merging 2 data sources pumpkin4455 Mailmerge 2 April 27th 06 04:17 PM
using two sources Fay Mailmerge 0 September 16th 05 02:35 PM


All times are GMT +1. The time now is 05:04 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"