locked
Creating Mail Merge document with embedded data connection RRS feed

  • Question

  • I created a mail merge document with a SQL Datasource.

    When I save the file, and give it to someone else to run on another machine, it asked for a datasource. 

    How do I embed the datasource (Servername, database, table, username, password, etc.)  into the document, so that it will use that one every time the mail merge occurs? 

    Thursday, September 22, 2011 5:41 PM

Answers

  • I think I probably replied to this question in the Answers forum, but the answer is that AFAIK you cannot embed a SQL Server data source connection in a Word Mail Merge document, despite the fact that (almost) all the necessary connectivity information is actually saved in the Connection string. Word insists that there is either a Machine or File DSN, a .udl file, or a .odc file. Even though it does not need one, uses .odc files in a non-standard way, and gains no benefit from the indirectoin that a .odc file theoretically provides.
    Peter Jamieson
    Tuesday, September 27, 2011 9:54 PM

All replies

  • Hi

     

    Thank you for using Microsoft Office for IT Professionals Forums.

     

    Is this SQL data source that is located on an http location?

    You cannot perform a mail merge with data source that is located on an http location, including a SharePoint location. When you try to do this, you may receive an error message.

    To work around this issue, you need to save the data source file either locally or onto the network drive (Mapped/UNC path). After you do this, you can perform a mail merge.

     

    You can refer to this link How to Merge a Word Document & SQL Database Fields

     

    “Data sources you can use for a mail merge”

    http://office.microsoft.com/en-us/word-help/data-sources-you-can-use-for-a-mail-merge-HP005187595.aspx?CTT=1

    “Frequently asked questions about the mail merge feature in Word 2003, Word 2007, and Word 2010”

    http://support.microsoft.com/kb/826838

    “How to automate Word to perform a client-side Mail Merge using XML from SQL Server”

    http://support.microsoft.com/kb/285176

     

    Please take your time to try the suggestions and let me know the results at your earliest convenience. If anything is unclear or if there is anything I can do for you, please feel free to let me know.

     

    Best regards

    William Zhou

    --------------------------------------------------------------------------------

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Tuesday, September 27, 2011 7:00 AM
  • I think I probably replied to this question in the Answers forum, but the answer is that AFAIK you cannot embed a SQL Server data source connection in a Word Mail Merge document, despite the fact that (almost) all the necessary connectivity information is actually saved in the Connection string. Word insists that there is either a Machine or File DSN, a .udl file, or a .odc file. Even though it does not need one, uses .odc files in a non-standard way, and gains no benefit from the indirectoin that a .odc file theoretically provides.
    Peter Jamieson
    Tuesday, September 27, 2011 9:54 PM