J
John Kounis
I recently converted from a .mdb file to a .adp front-end for a backend
running MSDE. There have been dramatic increases in performance, and I'm
happy with the conversion. However, one feature of the database--Microsoft
Word 2000 Automation-- is causing headaches.
The old version of the software had a line as follows:
wrdDoc.MailMerge.OpenDataSource Name:=CurrentProject.FullName,
LinkToSource:=True, Connection:="QUERY <my query name>"
Now that I have converted to an adp file, I apparently cannot use
"Name:=<filename>.adp" as a data source, so I tried:
wrdDoc.MailMerge.OpenDataSource Name:="", LinkToSource:="True", _
Connection:="Provider=SQLOLEDB;Persist Security Info=True;Data
Source=<SERVER>;User ID=<UID>;Password=<PWD>;Initial Catalog=<dbname>;" _
SQL_Statement:="SELECT * FROM <myviewname>"
Apparently, the above won't work on Word 2000. I think it's because Word
2000 cannot use OLE as a data source.
The next version (using an ODBC DSN) works, but I can't seem to get around
making the user type the password again:
wrdDoc.MailMerge.OpenDataSource Name:="<pathtomyqueryfile>.dqy",
LinkToSource:="True", _
Connection:="DSN=<myglobaldsn>;UID=<UID>;PWD=<PWD>;"_
SQL_Statement:="SELECT * FROM <myviewname>"
I was wondering if anyone out there knew the answers to the following
questions:
(1) Is Word 2000 not capable of using the SQLOLEDB provider as a data
source?
(2) Is there anyway to do a mailmerge from an ADP without requiring me to
store the password locally or ask the user for the password again? I cannot
figure out a way to retrieve the user's database password that was typed
when the DB was opened, and I think it's tedious to have to reenter it. This
was trivial with an MDB file, since I would simply specify
"NAME:=CurrentProject.FullName", and it would refer back to my mdb without
requiring another password.
(3) When I use a connection string for ODBC, specifying UID and PWD
parameters explicitly, why is the password ignored? Am I doing something
wrong.
(4) Since I'm explicitly giving a connection string and an SQL statement,
why must I also provide the parameter NAME:="xyz.dqy"' when using ODBC? It
seems superfluous to have to use MSQuary to create a .dqy file for each of
my queries.
I believe I must be overlooking something and there must be a better way to
do what I am trying to do. I'm confused, so any help would be appreciated.
Thanks!
John Kounis
running MSDE. There have been dramatic increases in performance, and I'm
happy with the conversion. However, one feature of the database--Microsoft
Word 2000 Automation-- is causing headaches.
The old version of the software had a line as follows:
wrdDoc.MailMerge.OpenDataSource Name:=CurrentProject.FullName,
LinkToSource:=True, Connection:="QUERY <my query name>"
Now that I have converted to an adp file, I apparently cannot use
"Name:=<filename>.adp" as a data source, so I tried:
wrdDoc.MailMerge.OpenDataSource Name:="", LinkToSource:="True", _
Connection:="Provider=SQLOLEDB;Persist Security Info=True;Data
Source=<SERVER>;User ID=<UID>;Password=<PWD>;Initial Catalog=<dbname>;" _
SQL_Statement:="SELECT * FROM <myviewname>"
Apparently, the above won't work on Word 2000. I think it's because Word
2000 cannot use OLE as a data source.
The next version (using an ODBC DSN) works, but I can't seem to get around
making the user type the password again:
wrdDoc.MailMerge.OpenDataSource Name:="<pathtomyqueryfile>.dqy",
LinkToSource:="True", _
Connection:="DSN=<myglobaldsn>;UID=<UID>;PWD=<PWD>;"_
SQL_Statement:="SELECT * FROM <myviewname>"
I was wondering if anyone out there knew the answers to the following
questions:
(1) Is Word 2000 not capable of using the SQLOLEDB provider as a data
source?
(2) Is there anyway to do a mailmerge from an ADP without requiring me to
store the password locally or ask the user for the password again? I cannot
figure out a way to retrieve the user's database password that was typed
when the DB was opened, and I think it's tedious to have to reenter it. This
was trivial with an MDB file, since I would simply specify
"NAME:=CurrentProject.FullName", and it would refer back to my mdb without
requiring another password.
(3) When I use a connection string for ODBC, specifying UID and PWD
parameters explicitly, why is the password ignored? Am I doing something
wrong.
(4) Since I'm explicitly giving a connection string and an SQL statement,
why must I also provide the parameter NAME:="xyz.dqy"' when using ODBC? It
seems superfluous to have to use MSQuary to create a .dqy file for each of
my queries.
I believe I must be overlooking something and there must be a better way to
do what I am trying to do. I'm confused, so any help would be appreciated.
Thanks!
John Kounis