Posted : Friday, January 29, 2016

Remove Message "Opening this will run the following SQL command" when you open a Word mail merge


When you open a mail merge main document in Microsoft Office Word, you experience one of the following symptoms:
You receive the following prompt:
Opening this document will run the following SQL command:
SELECT * FROM your datasource
Data from your database will be placed in the document. Do you want to continue?
Note If you click Yes, the mail merge main document opens with the data source attached. If you click No, the mail merge main document opens without the data source attached.

In Microsoft Office Word 2007, perform the following action while the prompt is displayed:
To determine the unique number that is associated with the message that you receive, press CTRL+SHIFT+I. The following number appears in the lower-right corner of this message:
201235
A mail merge main document that is opened by using Microsoft Visual Basic for Applications(VBA) does not have the data source attached.
Note It could be that you are using a program, for example Microsoft Access or Microsoft Visual FoxPro, to programmatically open a mail merge main document file when you experience the symptoms in this article.

To disable the security prompt by using the
SQLSecurityCheck
registry key, follow the appropriate steps for your version of Microsoft Word.

Word 2013

HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Word\Options 

"SQLSecurityCheck"=dword:00000000
  1. Start Registry Editor.
  2. Locate and then click the following registry key: HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Word\Options
  3. On the Edit menu, point to New, and then click DWORD Value.
  4. Under Name, type:
    SQLSecurityCheck
  5. Double-click SQLSecurityCheck.
  6. In the Value data box, type:
    00000000
  7. Click OK.

No comments:

Post a Comment