CreateDataSource & MailMerge

Giganews Newsgroups
Subject: CreateDataSource & MailMerge
Posted by:  hui (liuhui0…@3126.com)
Date: Fri, 27 Jul 2007

I wanna use CreateDataSource to build a connection between my word print
template and a table stored in SQL2K. But after I build the connection and
execute mailmerge, it doesn't work well. the following is my code, who could
tell me why? thanks

  {expression.CreateDataSource(Name, PasswordDocument,
WritePasswordDocument, HeaderRecord, MSQuery, SQLStatement, SQLStatement1,
Connection, LinkToSource)}

  Doc.MailMerge.CreateDataSource(
    'Microsoft.Jet.OLEDB.4.0',,,HeaderRecord,,'select * from mytable',,
'Provider=SQLOLEDB.1;Password=mypw;Persist Security Info=True;User
ID=sa;Initial Catalog=mydatabase;Data Source=myserver');

hui

Replies