Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Stored Procedure call and passing parameters

Hello
Can a SQL stored procedure be called (it takes five parameters) from Excel?
Can a "For Next loop" be used to supply those variable parameters? If you
use parameters do you call them the same way that you would in VB?
Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default Stored Procedure call and passing parameters

There are various ways of calling a parameterized stored procedure,
depending on data access technology used (ADO, ODBC, MS Query, etc)
and the DBMS product itself ('SQL' is vague - if you mean SQL Server,
say so). Post back with some more details, otherwise it's hard to
generalize.

--

"TLowe" wrote in message ...
Hello
Can a SQL stored procedure be called (it takes five parameters) from Excel?
Can a "For Next loop" be used to supply those variable parameters? If you
use parameters do you call them the same way that you would in VB?
Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Stored Procedure call and passing parameters

Thanks for the answer. Sorry to make the question to general.
I would like to use the ado command object to pass parameters to a stored
procedure in a MS2000 SQL server. I am currently just passing the query
back as a string. This is common in VB and I have used that in VB projects.
I need to do some modification and was wondering if Excel would support and
be able to use the command object to send a request to SQL server with
multiple parameters. Here is a sample of the method I am familiar with to
add a parameter to the command object.(watch for line break).

cmdStoredProc.Parameters.Append
cmdStoredProc.CreateParameter("@QuestionNumb", adInteger, adParamOutput, ,
mvar2)
Thanks for any help!

"onedaywhen" wrote in message
om...
There are various ways of calling a parameterized stored procedure,
depending on data access technology used (ADO, ODBC, MS Query, etc)
and the DBMS product itself ('SQL' is vague - if you mean SQL Server,
say so). Post back with some more details, otherwise it's hard to
generalize.

--

"TLowe" wrote in message
...
Hello
Can a SQL stored procedure be called (it takes five parameters) from

Excel?
Can a "For Next loop" be used to supply those variable parameters? If you
use parameters do you call them the same way that you would in VB?
Thanks



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default Stored Procedure call and passing parameters

Thanks for the additional info but I'm sorry, I still don't get what
you are asking.

If your question is, 'Can I modify this code to add multiple *input*
parameters?' then the answer is, 'Yes, append them to the Command's
paramters as per your existing code does but specify adParamInput.'

--

"TLowe" wrote in message ...
Thanks for the answer. Sorry to make the question to general.
I would like to use the ado command object to pass parameters to a stored
procedure in a MS2000 SQL server. I am currently just passing the query
back as a string. This is common in VB and I have used that in VB projects.
I need to do some modification and was wondering if Excel would support and
be able to use the command object to send a request to SQL server with
multiple parameters. Here is a sample of the method I am familiar with to
add a parameter to the command object.(watch for line break).

cmdStoredProc.Parameters.Append
cmdStoredProc.CreateParameter("@QuestionNumb", adInteger, adParamOutput, ,
mvar2)
Thanks for any help!

"onedaywhen" wrote in message
om...
There are various ways of calling a parameterized stored procedure,
depending on data access technology used (ADO, ODBC, MS Query, etc)
and the DBMS product itself ('SQL' is vague - if you mean SQL Server,
say so). Post back with some more details, otherwise it's hard to
generalize.

--

"TLowe" wrote in message
...
Hello
Can a SQL stored procedure be called (it takes five parameters) from

Excel?
Can a "For Next loop" be used to supply those variable parameters? If you
use parameters do you call them the same way that you would in VB?
Thanks

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
execute stored procedure Mark Goldin Excel Programming 3 April 7th 04 03:03 PM
Run a stored procedure in Excel 2K ArthurB Excel Programming 0 February 26th 04 04:46 PM
Execute stored procedure using DAO sapta wijaya Excel Programming 0 September 29th 03 04:24 AM
Passing properties to a procedure Matt McQueen[_2_] Excel Programming 1 July 30th 03 04:44 PM
Passing parameter from Excel to stored procedure? hmmm... Excel Programming 1 July 25th 03 02:59 PM


All times are GMT +1. The time now is 11:54 PM.

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

About Us

"It's about Microsoft Excel"