Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executing stored procedure from vba

Status
Not open for further replies.

davetek

Programmer
Oct 30, 2002
42
IE
hi,

i am trying to execute a stored procedure from excel(vba)...this works fine when i pass one parameter. however when i pass the second to the SP it does not work.


Cmd.ActiveConnection = cnt
Cmd.CommandType = adCmdStoredProc
Cmd.CommandText = "SP_CreateTest"
Cmd.Parameters.Append Cmd.CreateParameter("", adChar, sDate)
'Works up to this point
'but when i add the line below i get an error
Cmd.Parameters.Append Cmd.CreateParameter("", adChar, sName)

Cmd.Execute


any ideas???
 
Paste in the code of you SP up through the parameter definitions.
 
This part shows the parameters.

CREATE PROCEDURE au_info2
@lastname varchar(30) = 'D%',
@firstname varchar(18) = '%'
AS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top