Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
JWhitehead JWhitehead is offline
external usenet poster
 
Posts: 14
Default Office 2007 & ODBC

I am trying to do a mail merge in MS Word 2007 from an ODBC source. I am able
to find the option to do so. I go through this, but when I get the end, it
tells me there is errors with the merge, and no data is showing from the
merge.

If I import the data from ODBC to Access, for example, it shows all 450
records correctly. I can then do the mail merge in Word from there. The only
thing is, if the data that I've imported into Access changes in the original
table(s), other than re-importing, how would I get it to show the updated
data?

I guess what I'm asking here...
Is there a way to do a mail merge in MS Word 2007 to an ODBC source, and
actually be able to view the records?
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Office 2007 & ODBC

1. What is the data source?

2. Do you have Word 2007 SP2, or an earlier version of Word 2007?

3. Are you using Vista-64 bit, or perhaps another 64-bit version of Windows?

As far as point (2) is concerned, currently I only have Word 2007 Sp2 to
experiment with, and when I attempted an ODBC connection with Excel,
although the connection appeared to work fine, subsequent investigation
suggests that although it is an ODBC connection, Word is not going to
tell us what the connection string is.

Peter Jamieson

http://tips.pjmsn.me.uk

JWhitehead wrote:
I am trying to do a mail merge in MS Word 2007 from an ODBC source. I am able
to find the option to do so. I go through this, but when I get the end, it
tells me there is errors with the merge, and no data is showing from the
merge.

If I import the data from ODBC to Access, for example, it shows all 450
records correctly. I can then do the mail merge in Word from there. The only
thing is, if the data that I've imported into Access changes in the original
table(s), other than re-importing, how would I get it to show the updated
data?

I guess what I'm asking here...
Is there a way to do a mail merge in MS Word 2007 to an ODBC source, and
actually be able to view the records?

  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Office 2007 & ODBC

Can you link to the original table in Access?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"JWhitehead" wrote in message
...
I am trying to do a mail merge in MS Word 2007 from an ODBC source. I am
able
to find the option to do so. I go through this, but when I get the end, it
tells me there is errors with the merge, and no data is showing from the
merge.

If I import the data from ODBC to Access, for example, it shows all 450
records correctly. I can then do the mail merge in Word from there. The
only
thing is, if the data that I've imported into Access changes in the
original
table(s), other than re-importing, how would I get it to show the updated
data?

I guess what I'm asking here...
Is there a way to do a mail merge in MS Word 2007 to an ODBC source, and
actually be able to view the records?


  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
JWhitehead JWhitehead is offline
external usenet poster
 
Posts: 14
Default Office 2007 & ODBC

Yes. I can link to the orig in Access, and it shows the data. Just don't
think should have to link the table in access to do a mail merge in word when
it shows the option as available, and we were able to link it to an ODBC in
prev version of word.

"Doug Robbins - Word MVP" wrote:

Can you link to the original table in Access?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"JWhitehead" wrote in message
...
I am trying to do a mail merge in MS Word 2007 from an ODBC source. I am
able
to find the option to do so. I go through this, but when I get the end, it
tells me there is errors with the merge, and no data is showing from the
merge.

If I import the data from ODBC to Access, for example, it shows all 450
records correctly. I can then do the mail merge in Word from there. The
only
thing is, if the data that I've imported into Access changes in the
original
table(s), other than re-importing, how would I get it to show the updated
data?

I guess what I'm asking here...
Is there a way to do a mail merge in MS Word 2007 to an ODBC source, and
actually be able to view the records?



  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
JWhitehead JWhitehead is offline
external usenet poster
 
Posts: 14
Default Office 2007 & ODBC

1. The data source is w/in sage (our finance program).

2. Word 2007 w/ SP2

3. Windows Vista, 32-bit

If I pull the data into either Excel or Access, and then create the mail
merge in word using that as the data source it works no troubles. Just can't
seem to get it to work with the ODBC.

"Peter Jamieson" wrote:

1. What is the data source?

2. Do you have Word 2007 SP2, or an earlier version of Word 2007?

3. Are you using Vista-64 bit, or perhaps another 64-bit version of Windows?

As far as point (2) is concerned, currently I only have Word 2007 Sp2 to
experiment with, and when I attempted an ODBC connection with Excel,
although the connection appeared to work fine, subsequent investigation
suggests that although it is an ODBC connection, Word is not going to
tell us what the connection string is.

Peter Jamieson

http://tips.pjmsn.me.uk

JWhitehead wrote:
I am trying to do a mail merge in MS Word 2007 from an ODBC source. I am able
to find the option to do so. I go through this, but when I get the end, it
tells me there is errors with the merge, and no data is showing from the
merge.

If I import the data from ODBC to Access, for example, it shows all 450
records correctly. I can then do the mail merge in Word from there. The only
thing is, if the data that I've imported into Access changes in the original
table(s), other than re-importing, how would I get it to show the updated
data?

I guess what I'm asking here...
Is there a way to do a mail merge in MS Word 2007 to an ODBC source, and
actually be able to view the records?




  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Office 2007 & ODBC

I suspect you're going to have to use some VBA.

The problem I had earlier was that I could make an ODBC connection, but
then Word would not re-open it (it didn't even issue the usual "SQL"
prompt) when you saved/closed/re-opened your mail merge main document.
So I couldn't be sure what connection string Word was actually using.

However, the reason why Word will not re-open is typically because it
expects the data source to have a "file name", and when you open using a
machine ODBC DSN (i.e. user or system DSN), there is no file name. it is
possible that a similar problem is preventing Word from seeing your data
source correctly. This used to be OK in previous versions of Word but no
longer works in Word 2007 - I think it's actually an accidental change
rather than a deliberate attempt to scupper ODBC connections.

So I tried using a file DSN. Unfortunately, Word doesn't really like
them either so I don't think you can open them purely using the standard
Word user interface.

However, you do seem to be able to open using a file DSN using Word VBA
and an OpenDataSource statement. And in fact the "file DSN" doesn't even
need to be a real .dsn file. It can be a completely empty file that you
create in Notepad. You can provide completely different connection
information in the connection parameter. But you have to know what that
connection information should be.

For example, here's the VBA I was using with an empty excel.dsn

Sub ConnectViaEmptyFileDSN()
With ActiveDocument.MailMerge
' the following statement disconnects
' any existing source
.MainDocumentType = wdNotAMergeDocument
.OpenDataSource _
Name:="C:\Users\username\Documents\My Data Sources\excel.dsn", _
connection:="DSN=Excel
Files;DBQ=C:\mywbs\test.xls;DriverId=1046;MaxBuffe rSize=2048;PageTimeout=5;",
_
sqlstatement:="SELECT * FROM `Sheet1$`", _
SubType:=wdMergeSubTypeWord2000
End With
End Sub

In the above,
a. the Name parameter is set to the pathname of the (empty) .dsn
b. the connection string references a /user/ DSN (not a file DSN)
called "Excel Files". You presumably have a DSN that you use to connect
to Sage, and you would use that name instead. The rest of the connection
string contains values that would either typically be stored in the User
DSN anyway, such as MaxBufferSize, or values that are unique to this
connection - in this case

DBQ specifies the path name of the .xls file.

c. In your case, I don't know what would need to go in the
sqlstatement parameter, but it would probably be a simple "SELECT * FROM
[something]"



Alternatively, if you have a File DSN for your data source, you should
be able to do:

Sub ConnectViaCompleteFileDSN()
With ActiveDocument.MailMerge
' the following statement disconnects
' any existing source
.MainDocumentType = wdNotAMergeDocument
.OpenDataSource _
Name:="C:\Users\username\Documents\My Data Sources\excel.dsn", _
connection:="FILEDSN=C:\Users\username\Documents\M y Data
Sources\excel.dsn", _
sqlstatement:="SELECT * FROM `Sheet1$`", _
SubType:=wdMergeSubTypeWord2000
End With
End Sub

In other words, the same file is referenced by the Name parameter and
the FILEDSN keyword.

There are other "mix 'n' match" possibilities I think.

Not very nice but once you have set up your data source, Word /may/
reconnect to it when it re-opens the mail merge main document, and that
may be worth having.

If it works at all for /your/ data source, that is, and unfortunately as
I don't have Sage here I can't experiment.

Peter Jamieson

http://tips.pjmsn.me.uk

JWhitehead wrote:
1. The data source is w/in sage (our finance program).

2. Word 2007 w/ SP2

3. Windows Vista, 32-bit

If I pull the data into either Excel or Access, and then create the mail
merge in word using that as the data source it works no troubles. Just can't
seem to get it to work with the ODBC.

"Peter Jamieson" wrote:

1. What is the data source?

2. Do you have Word 2007 SP2, or an earlier version of Word 2007?

3. Are you using Vista-64 bit, or perhaps another 64-bit version of Windows?

As far as point (2) is concerned, currently I only have Word 2007 Sp2 to
experiment with, and when I attempted an ODBC connection with Excel,
although the connection appeared to work fine, subsequent investigation
suggests that although it is an ODBC connection, Word is not going to
tell us what the connection string is.

Peter Jamieson

http://tips.pjmsn.me.uk

JWhitehead wrote:
I am trying to do a mail merge in MS Word 2007 from an ODBC source. I am able
to find the option to do so. I go through this, but when I get the end, it
tells me there is errors with the merge, and no data is showing from the
merge.

If I import the data from ODBC to Access, for example, it shows all 450
records correctly. I can then do the mail merge in Word from there. The only
thing is, if the data that I've imported into Access changes in the original
table(s), other than re-importing, how would I get it to show the updated
data?

I guess what I'm asking here...
Is there a way to do a mail merge in MS Word 2007 to an ODBC source, and
actually be able to view the records?

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
Upgrading from Trial Version of Office 2007 to Office 2007 Standar Arlene Microsoft Word Help 7 February 10th 07 03:56 PM
ODBC Refresh Josvds Mailmerge 3 November 7th 06 10:57 AM
ODBC driver jilldean Microsoft Word Help 0 November 15th 05 10:55 AM
How do I reinstall the ODBC components Brian Mawer Microsoft Word Help 1 June 4th 05 11:29 PM
Word XP and ODBC Sources Cindy M -WordMVP- Mailmerge 0 November 30th 04 05:25 PM


All times are GMT +1. The time now is 10:42 PM.

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"