Access 2003 OpenDataSource

B

Bill Reagan

When we converted a database to Access 2003 from 2000, one piece of the
opendatasource code is no longer working.

The code is:

With WordDoc.MailMerge
.MainDocumentType = wdFormLetters
.OpenDataSource Name:="C:\TEST\test.mdb", LinkToSource:=True,
Connection:="TABLE LetterBuffer"
End With

For some reason, the Connection string does not seem to be working. This
code is identical to the code in the 2000 database. No matter what we put in
the " " the database does not appear to look in here. For example, if we have
only one table, the code works fine, no matter what the table name is and no
matter what is in the " " for the connection string. As soon as we have two
tables, and one IS called LetterBuffer, we get a select table dialog box when
the code is run that asks us to select the table, and one of the tables
listed is LetterBuffer. Did this parameter change in 2003 that is not
reflected in the help file? Any insight or help would be appreciated!!
 
J

John Nurick

Hi Bill,

I believe that the Word mailmerge object model changed between Word 2000
and Word 2002 but don't know the details. Looking at the help file, I'd
be inclined to try the following:

1) Omit the TABLE keyword from the Connection argument, just pass the
table name. (Queries and tables share the same namespace in ordinary
Access databases.)

2) Omit the Connection argument and pass a SQL statement in the SQL
argument, e.g.
... SQL:="SELECT * FROM LetterBuffer;"



On Thu, 6 Jan 2005 13:05:06 -0800, "Bill Reagan" <Bill
 
B

Bill

Thanks John. We tried taking out the word table but we get the same results.
I don't think we can use the SQL statement method because we are running our
code within Access to open a new word document and linking to the Access
tables using opendatasource.
 
A

Albert D. Kallal

John Nurick said:
It's ages since I've tried to automate Word mailmerge, but how about

1) Make sure the code works when you run it in Word (rather than in
Access)
2) Check out Albert Kallal's sample mailmerge application
http://www.attcanada.net/~kallal.msn/wordmerge/index.html

Yes, give my sample code a try. And, attcanada is no longer offering ISP
servicnes in canada..so, the above has been moved to:

http://www.members.shaw.ca/AlbertKallal/wordmerge/index.html

My sample does work in a2003....
 

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