|
|
I have a mailmerge set up using an ACCESS Query connected via an ODBC connection to a SQL database. When I set the mail merge up originally, it worked fine and brought in all the records. The database has been updated and when I re-run the query in ACCESS I see the new records, but in Word, even after "Refresh" in the mailmerge, the new records fail to show up. If I re-assign the same query as my data source, the record selection box shows no records. I am sure it has something to do withthe ODBC connection, but how do I get it to work properly without having to regenerate the entire mail merge?
Any help would be appreciated.
Cheers -- Tomk
|
|
Which version of Word/Access are you using, and which "connection method" are you using to get the data from Access (DDE, the default in Word 97/2000, OLE DB, the default in Word 2002 and later, or ODBC? Or maybe you are going through MS Query?)
Does the Access query use wildcards? Can you post the Query's SQL text here? (Actually, I do not think this can be relevant if the query is working OK the first time you use it, but this is "just in case")
With your mail merge main document open and the data source /newly/ attached (i.e. so you see some records) can you start the Word VBA Editor, type the following in the Immediate window and post the results here. (If it's Word 2002, unfortunately you may find that trying to print the connectstring crashes Word, so I would leave that one out in that case)
print activedocument.mailmerge.datasource.name print activedocument.mailmerge.datasource.connectstring print activedocument.mailmerge.datasource.querystring
Peter Jamieson
"TOMK" <TOMK[ at ]discussions.microsoft.com> wrote in message news:B904E8EB-4FB2-4EA1-ADA8-628C35BE194C[ at ]microsoft.com...
[Quoted Text] >I have a mailmerge set up using an ACCESS Query connected via an ODBC > connection to a SQL database. When I set the mail merge up originally, it > worked fine and brought in all the records. The database has been updated > and when I re-run the query in ACCESS I see the new records, but in Word, > even after "Refresh" in the mailmerge, the new records fail to show up. > If I > re-assign the same query as my data source, the record selection box shows > no > records. I am sure it has something to do withthe ODBC connection, but > how > do I get it to work properly without having to regenerate the entire mail > merge? > > Any help would be appreciated. > > Cheers > -- > Tomk
|
|
Thanks, Peter.
I will try this tomorrow from work. It is Word and ACESS 2003.
I appreciate your help. -- Tomk
"Peter Jamieson" wrote:
[Quoted Text] > Which version of Word/Access are you using, and which "connection method" > are you using to get the data from Access (DDE, the default in Word 97/2000, > OLE DB, the default in Word 2002 and later, or ODBC? Or maybe you are going > through MS Query?) > > Does the Access query use wildcards? Can you post the Query's SQL text here? > (Actually, I do not think this can be relevant if the query is working OK > the first time you use it, but this is "just in case") > > With your mail merge main document open and the data source /newly/ attached > (i.e. so you see some records) can you start the Word VBA Editor, type the > following in the Immediate window and post the results here. (If it's Word > 2002, unfortunately you may find that trying to print the connectstring > crashes Word, so I would leave that one out in that case) > > print activedocument.mailmerge.datasource.name > print activedocument.mailmerge.datasource.connectstring > print activedocument.mailmerge.datasource.querystring > > Peter Jamieson > > > "TOMK" <TOMK[ at ]discussions.microsoft.com> wrote in message > news:B904E8EB-4FB2-4EA1-ADA8-628C35BE194C[ at ]microsoft.com... > >I have a mailmerge set up using an ACCESS Query connected via an ODBC > > connection to a SQL database. When I set the mail merge up originally, it > > worked fine and brought in all the records. The database has been updated > > and when I re-run the query in ACCESS I see the new records, but in Word, > > even after "Refresh" in the mailmerge, the new records fail to show up. > > If I > > re-assign the same query as my data source, the record selection box shows > > no > > records. I am sure it has something to do withthe ODBC connection, but > > how > > do I get it to work properly without having to regenerate the entire mail > > merge? > > > > Any help would be appreciated. > > > > Cheers > > -- > > Tomk >
|
|
Peter,
I am not 100% sure what I did, but I retried the re-linking the query and set up a new connection with ODBC, and I got it working. I think it was an issue with the Password not being refreshed somehow, and that was why I wasn't getting any data.
I do appreciate the fact that you responded and helped me out.
Regards
Tom -- Tomk
"Peter Jamieson" wrote:
[Quoted Text] > Which version of Word/Access are you using, and which "connection method" > are you using to get the data from Access (DDE, the default in Word 97/2000, > OLE DB, the default in Word 2002 and later, or ODBC? Or maybe you are going > through MS Query?) > > Does the Access query use wildcards? Can you post the Query's SQL text here? > (Actually, I do not think this can be relevant if the query is working OK > the first time you use it, but this is "just in case") > > With your mail merge main document open and the data source /newly/ attached > (i.e. so you see some records) can you start the Word VBA Editor, type the > following in the Immediate window and post the results here. (If it's Word > 2002, unfortunately you may find that trying to print the connectstring > crashes Word, so I would leave that one out in that case) > > print activedocument.mailmerge.datasource.name > print activedocument.mailmerge.datasource.connectstring > print activedocument.mailmerge.datasource.querystring > > Peter Jamieson > > > "TOMK" <TOMK[ at ]discussions.microsoft.com> wrote in message > news:B904E8EB-4FB2-4EA1-ADA8-628C35BE194C[ at ]microsoft.com... > >I have a mailmerge set up using an ACCESS Query connected via an ODBC > > connection to a SQL database. When I set the mail merge up originally, it > > worked fine and brought in all the records. The database has been updated > > and when I re-run the query in ACCESS I see the new records, but in Word, > > even after "Refresh" in the mailmerge, the new records fail to show up. > > If I > > re-assign the same query as my data source, the record selection box shows > > no > > records. I am sure it has something to do withthe ODBC connection, but > > how > > do I get it to work properly without having to regenerate the entire mail > > merge? > > > > Any help would be appreciated. > > > > Cheers > > -- > > Tomk >
|
|
OK. I have certainly had "timing" problems with some types of Word 2003/Access 2003 queries (and the same problems did not exist in Word 2002/Access 2002) where the query referenced a table in another .mdb or database.
Peter Jamieson
"TOMK" <TOMK[ at ]discussions.microsoft.com> wrote in message news:96BCBB24-AC28-4414-987B-E2BFD3EA064C[ at ]microsoft.com...
[Quoted Text] > Peter, > > I am not 100% sure what I did, but I retried the re-linking the query and > set up a new connection with ODBC, and I got it working. I think it was > an > issue with the Password not being refreshed somehow, and that was why I > wasn't getting any data. > > I do appreciate the fact that you responded and helped me out. > > Regards > > Tom > -- > Tomk > > > "Peter Jamieson" wrote: > >> Which version of Word/Access are you using, and which "connection method" >> are you using to get the data from Access (DDE, the default in Word >> 97/2000, >> OLE DB, the default in Word 2002 and later, or ODBC? Or maybe you are >> going >> through MS Query?) >> >> Does the Access query use wildcards? Can you post the Query's SQL text >> here? >> (Actually, I do not think this can be relevant if the query is working OK >> the first time you use it, but this is "just in case") >> >> With your mail merge main document open and the data source /newly/ >> attached >> (i.e. so you see some records) can you start the Word VBA Editor, type >> the >> following in the Immediate window and post the results here. (If it's >> Word >> 2002, unfortunately you may find that trying to print the connectstring >> crashes Word, so I would leave that one out in that case) >> >> print activedocument.mailmerge.datasource.name >> print activedocument.mailmerge.datasource.connectstring >> print activedocument.mailmerge.datasource.querystring >> >> Peter Jamieson >> >> >> "TOMK" <TOMK[ at ]discussions.microsoft.com> wrote in message >> news:B904E8EB-4FB2-4EA1-ADA8-628C35BE194C[ at ]microsoft.com... >> >I have a mailmerge set up using an ACCESS Query connected via an ODBC >> > connection to a SQL database. When I set the mail merge up originally, >> > it >> > worked fine and brought in all the records. The database has been >> > updated >> > and when I re-run the query in ACCESS I see the new records, but in >> > Word, >> > even after "Refresh" in the mailmerge, the new records fail to show up. >> > If I >> > re-assign the same query as my data source, the record selection box >> > shows >> > no >> > records. I am sure it has something to do withthe ODBC connection, but >> > how >> > do I get it to work properly without having to regenerate the entire >> > mail >> > merge? >> > >> > Any help would be appreciated. >> > >> > Cheers >> > -- >> > Tomk >>
|
|
|