Link to home
Start Free TrialLog in
Avatar of holemania
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.

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

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of SiddharthRout
SiddharthRout
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Chris Bottomley
Line 8 try modifying:

Set par1 = CreateObject("ADODB.Parameter")
to
Set par1 = cmd.parameter


Chris
Avatar of holemania
holemania

ASKER

Thanks there were a number of issues, but got it working now.