How to Strip SQL Command, Mail Merge Data from MS 365 Word Document

Anonymous
2022-09-13T19:50:36+00:00

I've receive a Word file created in MS 365 (2022), and every time I open the doc, this pops up:

Opening this document will run the following SQL command:

SELECT * FROM 'Rotated$'

Data from your database will be placed in the document. Do you want to continue?

I've tried

  • saying No, then going to Mailings > Start Main Merge > Normal Word Document and resaving
  • saying Yes, saying OK to the "An Operation cannot be completed because of database engine errors," then tried deleting the Data Source from the Connection tab, then selecting OK.

Everything I've tried so far fails after resaving, because the pop up above continues to reappear. I need to provide this file to several clients and do not want that pop up appearing.

I want to strip the data source from this Word document so the pop up never appears again. What are the steps to achieve that?

Thanks for your help.

Microsoft 365 and Office | Word | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Doug Robbins - MVP - Office Apps and Services 323.5K Reputation points MVP Volunteer Moderator
    2022-09-13T22:26:27+00:00

    If you access the Start Mail Merge dropdown and select Normal Word document, that WILL strip the data source from it so that when you then save and re-open the document, the SQL warning message will NOT appear.

    While it is possible to modify the registry so that the SQL warning does not appear, as you have external users involved, that is not a workable solution as it will only apply to your machine.

    If you are still having a problem, send me a copy of the document, referencing this thread in the covering email message, and I will investigate the issue.

    Was this answer helpful?

    10+ people found this answer helpful.
    0 comments No comments
  2. Paul Edstein 82,866 Reputation points Volunteer Moderator
    2022-09-13T23:34:35+00:00

    I need to provide this file to several clients and do not want that pop up appearing.

    I want to strip the data source from this Word document so the pop up never appears again. What are the steps to achieve that?

    If you answer 'No' to the SQL prompt then save the document, it will be saved as a normal Word document with no links to the data source and no SQL prompt next time you open it.

    Do be aware that doing this will not remove the merge fields from the document and, no longer being linked to the data source, will no longer be able to display anything other than the last previewed record - and even that will be lost once anything causes Word to refresh the field display (e.g. printing or previewing the document). If you need your clients to see the output, you need to complete the merge for the record(s) concerned from the mailmerge main document, then send the output from that to the clients.

    Was this answer helpful?

    7 people found this answer helpful.
    0 comments No comments