Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Graham is offline
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Cindy M. Cindy M. is offline
external usenet poster
 
Posts: 2,416
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Graham is offline
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Todd K. Todd K. is offline
external usenet poster
 
Posts: 27
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default 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

Posting Rules

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I mail merge to EMAIL from MS Word AND add a pdf attachment Lily@Insight Mailmerge 24 January 15th 07 09:33 PM
Heavy Mail Merge Application Atul Mailmerge 1 August 17th 06 02:37 PM
mail merge documents moved from one server to another server don't Derek Ruesch Mailmerge 0 September 8th 05 06:36 PM
Mail Merge - Parameter prompts twice... TL Mailmerge 6 June 17th 05 02:58 PM
The remote server machine does not exist or is unavailable on Mail Merge Vic Spainhower Mailmerge 7 December 6th 04 03:03 PM


All times are GMT +1. The time now is 10:47 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"