Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Mail Merge to SQL Server without using an external ODC
Is there any way to embed the SQL Server connection information right
into a Word document? I'd like to be able to e-mail the document to others within the organization without having to navigate them through the process of creating a data source. (They all have access to the SQL server, of course.) Thanks, g. |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Mail Merge to SQL Server without using an external ODC
Hi Graham,
Is there any way to embed the SQL Server connection information right into a Word document? I'd like to be able to e-mail the document to others within the organization without having to navigate them through the process of creating a data source. (They all have access to the SQL server, of course.) Which version of Word are we discussing? And do your systems have an ODBC driver for SQL Server installed? I think it can't be done for OLE DB, as this also requires an external *.odc file. ODBC can probably do it. And a macro that links the data source when the file opens could probably work. Another possibility (and it's what MSFT had in mind when they designed the interface) would be to distribute the *.odc file for the connection to everyone's "My Data Source" folder. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Mail Merge to SQL Server without using an external ODC
Cindy M.
wrote: Hi Graham, Is there any way to embed the SQL Server connection information right into a Word document? Which version of Word are we discussing? And do your systems have an ODBC driver for SQL Server installed? I think it can't be done for OLE DB, as this also requires an external *.odc file. ODBC can probably do it. And a macro that links the data source when the file opens could probably work. Another possibility (and it's what MSFT had in mind when they designed the interface) would be to distribute the *.odc file for the connection to everyone's "My Data Source" folder. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005) http://www.word.mvps.org Word 2003, and all Microsoft systems have the SQL ODBC driver installed. The distribution path you describe would require an installer, which is a heck of a lot of trouble to get a 25-character connection string down to the users' machines. Honestly, I think this is another of those situations where Microsoft didn't have *anything* in mind. g. |
#4
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Mail Merge to SQL Server without using an external ODC
Did you work out how to do the ODBC connection?
Honestly, I think this is another of those situations where Microsoft didn't have *anything* in mind. I certainly don't understand why they insist that you have an external object of some kind and don't allow DSN-less and ODC-less connections, unless of course they were a. worried that the end result would be loads of .doc files with embedded plain text login/password info. (but if you're using SQL Server integrated security that's wouldn't be an issue anyway) or b. worried that then people would be able to distibute their merge qapplications reasonably easily :-) Peter Jamieson "Graham" wrote in message oups.com... Cindy M. wrote: Hi Graham, Is there any way to embed the SQL Server connection information right into a Word document? Which version of Word are we discussing? And do your systems have an ODBC driver for SQL Server installed? I think it can't be done for OLE DB, as this also requires an external *.odc file. ODBC can probably do it. And a macro that links the data source when the file opens could probably work. Another possibility (and it's what MSFT had in mind when they designed the interface) would be to distribute the *.odc file for the connection to everyone's "My Data Source" folder. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005) http://www.word.mvps.org Word 2003, and all Microsoft systems have the SQL ODBC driver installed. The distribution path you describe would require an installer, which is a heck of a lot of trouble to get a 25-character connection string down to the users' machines. Honestly, I think this is another of those situations where Microsoft didn't have *anything* in mind. g. |
#5
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Mail Merge to SQL Server without using an external ODC
Peter -
I have a similar situation. I have code that works when the source is an Access table (see below), but when the source changed to SQL Server it quit working. Is there a different protocol for SQL Server or is it probably in the routing?: Private Sub Document_Open() Me.MailMerge.OpenDataSource _ Name:="I:\Applications\Databases\ProjectOne.adp", _ LinkToSource:=True, _ Connection:="TABLE TblAmendment_Ren", _ SQLStatement:="SELECT * FROM [TblAmendment_Ren]" Me.MailMerge.Destination = wdSendToNewDocument Me.MailMerge.Execute Windows(Me).Close wdDoNotSaveChanges End Sub "Peter Jamieson" wrote: Did you work out how to do the ODBC connection? Honestly, I think this is another of those situations where Microsoft didn't have *anything* in mind. I certainly don't understand why they insist that you have an external object of some kind and don't allow DSN-less and ODC-less connections, unless of course they were a. worried that the end result would be loads of .doc files with embedded plain text login/password info. (but if you're using SQL Server integrated security that's wouldn't be an issue anyway) or b. worried that then people would be able to distibute their merge qapplications reasonably easily :-) Peter Jamieson "Graham" wrote in message oups.com... Cindy M. wrote: Hi Graham, Is there any way to embed the SQL Server connection information right into a Word document? Which version of Word are we discussing? And do your systems have an ODBC driver for SQL Server installed? I think it can't be done for OLE DB, as this also requires an external *.odc file. ODBC can probably do it. And a macro that links the data source when the file opens could probably work. Another possibility (and it's what MSFT had in mind when they designed the interface) would be to distribute the *.odc file for the connection to everyone's "My Data Source" folder. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005) http://www.word.mvps.org Word 2003, and all Microsoft systems have the SQL ODBC driver installed. The distribution path you describe would require an installer, which is a heck of a lot of trouble to get a 25-character connection string down to the users' machines. Honestly, I think this is another of those situations where Microsoft didn't have *anything* in mind. g. |
#6
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Mail Merge to SQL Server without using an external ODC
Which version of Word?
At the moment I'd guess your code is using DDE to get the data (i.e. Access will open and get the data). When you say that the source changed to SQl Server do you mean that the underlying data moved to SQL Server (and that you still have linked tables in your .adp) or that the whole thing moved to SQL Server? For starters, to connect directly to SQL Server you need either a. a suitable ODBC DSN (either "machine" DSN or .dsn file) or b. a suitable OLE DB .udl file or c. a suitable OLE DB .odc file I can go into the details if necessary but maybe that will take you a step further. As a rule, an OLE DB connection is advisable, and essential if your SQl Server database has Unicode fields in it (which it almost certainly will have if it was created from an Access project using the Upsizing wizard. Connecting to SQL Server tables and views should be straightforward, security issues permitting, but connecting to stored procedures/stored functions is another matter. Peter Jamieson "Todd K." wrote in message news Peter - I have a similar situation. I have code that works when the source is an Access table (see below), but when the source changed to SQL Server it quit working. Is there a different protocol for SQL Server or is it probably in the routing?: Private Sub Document_Open() Me.MailMerge.OpenDataSource _ Name:="I:\Applications\Databases\ProjectOne.adp", _ LinkToSource:=True, _ Connection:="TABLE TblAmendment_Ren", _ SQLStatement:="SELECT * FROM [TblAmendment_Ren]" Me.MailMerge.Destination = wdSendToNewDocument Me.MailMerge.Execute Windows(Me).Close wdDoNotSaveChanges End Sub "Peter Jamieson" wrote: Did you work out how to do the ODBC connection? Honestly, I think this is another of those situations where Microsoft didn't have *anything* in mind. I certainly don't understand why they insist that you have an external object of some kind and don't allow DSN-less and ODC-less connections, unless of course they were a. worried that the end result would be loads of .doc files with embedded plain text login/password info. (but if you're using SQL Server integrated security that's wouldn't be an issue anyway) or b. worried that then people would be able to distibute their merge qapplications reasonably easily :-) Peter Jamieson "Graham" wrote in message oups.com... Cindy M. wrote: Hi Graham, Is there any way to embed the SQL Server connection information right into a Word document? Which version of Word are we discussing? And do your systems have an ODBC driver for SQL Server installed? I think it can't be done for OLE DB, as this also requires an external *.odc file. ODBC can probably do it. And a macro that links the data source when the file opens could probably work. Another possibility (and it's what MSFT had in mind when they designed the interface) would be to distribute the *.odc file for the connection to everyone's "My Data Source" folder. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005) http://www.word.mvps.org Word 2003, and all Microsoft systems have the SQL ODBC driver installed. The distribution path you describe would require an installer, which is a heck of a lot of trouble to get a 25-character connection string down to the users' machines. Honestly, I think this is another of those situations where Microsoft didn't have *anything* in mind. g. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I mail merge to EMAIL from MS Word AND add a pdf attachment | Mailmerge | |||
Heavy Mail Merge Application | Mailmerge | |||
mail merge documents moved from one server to another server don't | Mailmerge | |||
Mail Merge - Parameter prompts twice... | Mailmerge | |||
The remote server machine does not exist or is unavailable on Mail Merge | Mailmerge |