holemania
asked on
vbscript - excuting stored procedure error
I have a vbscript that I would like to call out a stored procedure and execute. There's one parameter that will be use. However, I kept getting the following error.
Below is my script.
Arguments are of the wrong type, are out of acceptable range, or are in conflit with one another. At line 8 position 0.
Below is my script.
Dim cmd
Dim sp
sp = "DIMENSION"
Set cmd = CreateObject("ADODB.Command")
Set par1 = CreateObject("ADODB.Parameter")
par1.Direction=adParamInput
par1.name = "@PO"
par1.size = 30
par1.Type = adVarchar
par1.Value = ORDER_ID
With cmd
.ActiveConnection = "Provider=SQLOLEDB;Server=DBSVR1;Database=TESTDB;UID=USER1;pwd=Password1"
.CommandType = 4
.CommedText = sp
.Execute
End With
Set cmd = Nothing
Set par1 = Nothing
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks there were a number of issues, but got it working now.
Set par1 = CreateObject("ADODB.Parame
to
Set par1 = cmd.parameter
Chris