MailMerge using SQLServer stored proceedure

M

Michael

I'm automating Word to perform a mail merge. After creating a new Document
and getting the MailMerge object I call OpenDataSource passing the connection
information (Name parameter) and an SQLStatement. This works fine for SELECT
queries on tables and views but it doesn't like stored proceedures.

What is the correct format for the SQLStatement when calling a stored
proceedure?

I'm using the OLEDB provider for SQLServer.

Thanks
Michael
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?TWljaGFlbA==?=,

Peter Jamieson has much more experience dealing with mail merge and SQL Server.
I suggest asking this in the word.mailmerge.fields newsgroup.
I'm automating Word to perform a mail merge. After creating a new Document
and getting the MailMerge object I call OpenDataSource passing the connection
information (Name parameter) and an SQLStatement. This works fine for SELECT
queries on tables and views but it doesn't like stored proceedures.

What is the correct format for the SQLStatement when calling a stored
proceedure?

I'm using the OLEDB provider for SQLServer.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top