Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to execute parametrised stored procedure from MS query?

Hi !
How to execute a parametrised stored procedure from MS query to MS SQL
database? If it's possible.

Regards
Otto
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default How to execute parametrised stored procedure from MS query?

Otto,
Using ADO ?

Check the Command and .CommandType, .Parameters.Add etc.
I seem to remember that even though there is a
comm.CommandType = adCmdStoredProc
you need to use
CommandType = adCmdText
for this to work.

NickHK

"Otto4444" ...
Hi !
How to execute a parametrised stored procedure from MS query to MS SQL
database? If it's possible.

Regards
Otto



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default How to execute parametrised stored procedure from MS query?

Hi Otto,

You can certainly do it.

Set up your MSQUERY and add your parameter fields eg: In MSQUERY,
select a field in the criteria field and then in the Value, use
something like

=[%MYDATE]


So MYDATE becomes a parameter field. When you save the query in the
editor, you'll be prompted for the value of %MYDATE - leave it blank.

Back in Excel, put the query results somewhere, then Right-Click on the
Top Row (where the field names are). Select EDIT PARAMETERS. You'll
be offered the list of your parameter fields and some options on how to
deal with them.

Option1 - Prompt for the Value
Option2 - Set a default value
Option3 - Get the value from a CELL

Remember that where using DATES, MSQUERY wants dates in this format
30-SEP-06, which can be a pain.

Regards


Greg



Otto4444 wrote:
Hi !
How to execute a parametrised stored procedure from MS query to MS SQL
database? If it's possible.

Regards
Otto


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can I execute stored procedure to download data Bill[_36_] Excel Programming 1 December 1st 05 07:03 PM
MS Query to read data from SQL server stored procedure Souris Excel Programming 0 May 11th 05 06:34 PM
execute stored procedure from excel maxzsim Excel Worksheet Functions 3 May 11th 05 04:58 PM
execute stored procedure Mark Goldin Excel Programming 3 April 7th 04 03:03 PM
Execute stored procedure using DAO sapta wijaya Excel Programming 0 September 29th 03 04:24 AM


All times are GMT +1. The time now is 04:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"