DATABASE ODBC连接请求每个合并上的数据链接属性 [英] DATABASE ODBC Connection requests Data Link Properties on each merge

查看:133
本文介绍了DATABASE ODBC连接请求每个合并上的数据链接属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


使用Word 2010,我有一个邮件合并文档,使用Excel表作为主要合并源。该文档包括成功执行查询的DATABASE字段代码,但是对话框"数据链接属性"可以包括在内。请求数据库
信息出现在每个合并文档的开头。如何在不请求每个文档的数据链接属性的情况下执行DATABASE查询? 查询的数据库源是本地用户ODBC数据库连接。


字段代码:


{DATABASE  \d" C:\\Dummy.odc" \b 1 \l 1 \c" DSN = LocalUserODBCSourceName;" \s"从表名
中选择NAME,其中a.rmsacctnum = {
MERGEFIELD" ACCTNUM"}
" \\\}



我试过了字段代码有和没有\d参数。  dummy.odc的当前\d参数来自另一篇文章的推荐。 

解决方案

尝试省略:

\ c" DSN = LocalUserODBCSourceName;"

并使用真实源文件的名称&路径 带有\d参数。


另请参阅:
http://answers.microsoft.com / EN-US / MSOFFICE /论坛/ msoffice_word-mso_winother /多到一个电子邮件合并,用桌/ 8bce1798-fbe8-41f9-a121-1996c14dca5d?页= 1


Using Word 2010, I have a mail merge document using an Excel table as the primary merge source. The document includes a DATABASE field code that executes a query successfully, however the dialog box "Data Link Properties" requesting the database information appears at the start of each merge document. How can I get the DATABASE query to execute without requesting the Data Link Properties on each document?  The database source for the query is an Local User ODBC data base connection.

Field Code:

{DATABASE  \d "C:\\Dummy.odc" \b 1 \l 1 \c "DSN=LocalUserODBCSourceName;" \s "select NAME, from tablename where a.rmsacctnum = {MERGEFIELD "ACCTNUM"} " \h}

I have tried the field code with and without the \d parameter.  The current \d parameter of a dummy.odc came from a recommendation from another post. 

解决方案

Try omitting:
\c "DSN=LocalUserODBCSourceName;"
and using the real source file's name & path with the \d parameter.

See also: http://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-mso_winother/many-to-one-email-merge-using-tables/8bce1798-fbe8-41f9-a121-1996c14dca5d?page=1


这篇关于DATABASE ODBC连接请求每个合并上的数据链接属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆