Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / March 2004

Tip: Looking for answers? Try searching our database.

Database Field Code and SQL Stored Procedures

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Curtis Justus - 10 Mar 2004 21:25 GMT
Hello,

Is it possible to specify a SQL Server stored procedure in the \s switch of
a {DATABASE} field code?

Thanks,
cj
Peter Jamieson - 10 Mar 2004 23:16 GMT
Yes, but there may be constraints on the type of procedure you want to call,
e.g. it probably has to return a single table.

e.g. for the stored procedure supplied with the Northwind sample database
called CustOrdersOrders use

\s "{ call CustOrdersOrders('ALFKI') }"

to get the Orders for Customer with ID ALFKI. As far as I can see this works
with ODBC in Word 2000, 2002 and 2003, and with OLEDB in Word 2003.

However, if the procedure name contains spaces I do not know how you quote
them - no quotes, " ", ' ', [] and \" \" all fail.

Signature

Peter Jamieson - Word MVP
Word MVP web site http://word.mvps.org/

> Hello,
>
[quoted text clipped - 3 lines]
> Thanks,
> cj
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.