View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jamie Collins Jamie Collins is offline
external usenet poster
 
Posts: 593
Default External Data from Stored Procedure with parameters


Ben Rum wrote:
when the user selects "Refresh Data!" I
would like the user to be prompted to enter the values as per the

stored
procedure parameters..

e.g. exec sp_MySpName @StartDate = [prompt user], @EndDate = [prompt

user]

Is this possible?


It is not possible to get MSQuery to automatically prompt for the
parameters.

To be able to use MSQuery parameters, the SQL must be a simple SELECT
written in MSQuery's own SQL dialect, rather than that odbc syntax or
the dialect of the database server. Using odbc's CALL syntax, ANSI's
EXECUTE syntax or anything proprietary will result in the 'cannot
display graphically' (whatever that means) message, after which
built-in support for parameters is lost.

You can, of course, write VBA to dynamically change the querytable's
SQL
text, then everything will be up for grabs, including throwing up
userforms with calendar controls on them, but you will have to write it
yourself <g.

Jamie.

--