M
Mo Bandy
Please help. Never used Stored Procedures in my life!
I need to call a stored procedure from a Classic ASP vbscript page. The SP
takes two params (itemkey and qty) both integers and returns the qty
available for that particular item.
What I got ain't working. Getting a syntax error.
dim cn, cmd, nextorder, ItemKey, allocQty
Const adExecuteNoRecords = &H00000080
Const adCmdStoredProc = &H0004
Const adParamReturnValue = &H0004
Const adParamInput = &H0004
Const adInteger = 3
ItemKey = 20599
allocqty = 1
set cn=createobject("adodb.connection")
cn.open "Provider=SQLOLEDB; Data Source = webstore; Initial Catalog = EComm;
User Id = xxxx; Password = xxxxxx"
set cmd=createobject("adodb.command")
with cmd
.commandtext="ap_allocateitem " & itemkey & ", " & allocqty
.CommandType=adCmdStoredProc
set .activeconnection = cn
.Parameters.Append .CreateParameter("RETURN_VALUE",
adInteger,adParamReturnValue)
.Parameters.Append .CreateParameter("@ItemKey", adInteger,adParamInput)
.Parameters.Append .CreateParameter("@allocqty", adInteger,adParamInput)
.execute
intQty = .Parameters(0).value
end with
I need to call a stored procedure from a Classic ASP vbscript page. The SP
takes two params (itemkey and qty) both integers and returns the qty
available for that particular item.
What I got ain't working. Getting a syntax error.
dim cn, cmd, nextorder, ItemKey, allocQty
Const adExecuteNoRecords = &H00000080
Const adCmdStoredProc = &H0004
Const adParamReturnValue = &H0004
Const adParamInput = &H0004
Const adInteger = 3
ItemKey = 20599
allocqty = 1
set cn=createobject("adodb.connection")
cn.open "Provider=SQLOLEDB; Data Source = webstore; Initial Catalog = EComm;
User Id = xxxx; Password = xxxxxx"
set cmd=createobject("adodb.command")
with cmd
.commandtext="ap_allocateitem " & itemkey & ", " & allocqty
.CommandType=adCmdStoredProc
set .activeconnection = cn
.Parameters.Append .CreateParameter("RETURN_VALUE",
adInteger,adParamReturnValue)
.Parameters.Append .CreateParameter("@ItemKey", adInteger,adParamInput)
.Parameters.Append .CreateParameter("@allocqty", adInteger,adParamInput)
.execute
intQty = .Parameters(0).value
end with