15

I am using Microsoft Word 2013.  I have a document that, when opened, prompts me with:

Opening this document will run the following SQL command:
SELECT * FROM C:\somepath\somefile.mrg
Data from your database will be placed in the document.  Do you want to continue?

I am trying to find where in the Word document this data source is being specified, and hopefully remove it completely.

7 Answers7

17

In many (if not all) cases, answering "No" to this prompt should be enough to disconnect the data source. But you should then save the document, and try opening it again.

If that doesn't work, try to get to the point where the document is open, then open the Mailings tab, click the Start Mail Merge button in the Start Mail Merge group, then select Normal Word Document from the dropdown. Then save the document.

If you don't save the document after disconnecting the data source, the problem will recur.

2

This took me eternity so I thought I'd post an answer as well.

In my case I had to remove the old template document, which triggered the query.

This is possible in the developer tools menu, on the very right.

0

I agree with a previous post, here is a little adjustment.

Answering "No" to this prompt was not enough to disconnect the data source. Go to the Mailings tab, click the Start Mail Merge button in the Start Mail Merge group, then select Normal Word Document from the dropdown. Then save the document. If you don't save the document after disconnecting the data source, obiously the problem will recur.

0

There is a much simpler fix.

  • Open the merge document
  • At the prompt to run the query answer no. The document displays with no data.
  • Use Save as to save the document to the same folder using the same name
  • When prompted to overwrite the original say yes
Destroy666
  • 12,350
0

In my case I wanted to un-merge the data - keep the document as a mailmerge but not show peoples' specific details in the document each time I opened it. I finally was able to do this by going through the mailmerge wizard, and when it came to selecting recipients with the little checkboxes, unchecking all of them. When I closed the wizard it looked like a mailmerge form again without individual data; I saved it as a new document to maintain this.

Kaleh
  • 1
0

If you are using Word 2010, open the document, click on the Mailings tab, click the down arrow under the Start Mail Merge button, click on Normal Word Document. This will disconnect the Word document from the source document.

Payat
  • 1
-2

Go to File then-> Options then-> Trust Center then-> Trust Center Settings then-> Privacy Options then-> Document Inspector then-> Inspect and then remove XML data.