Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mail Merge and dynamic SQL

Status
Not open for further replies.

qwerty906

MIS
Jul 24, 2002
24
0
0
HK
just a quick question maybe one of you can answer. I'm trying to do a mail merge that takes in a dynamic SQL statement. If i use the following statement i can pull the data from a query

objWord.ActiveDocument.MailMerge.OpenDataSource Name:=strDBPath, LinkToSource:=True, AddToRecentFiles:=False, Connection:="QUERY " & strDataSource

but how do i do it so that i can pass a SQL statement instead? is it possible using this method or do i have to use ODBC? and if i have to use ODBC do i need to create a DSN on each machine or can i build a connection string without A DSN name. thanks a million.

jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top