-
Hi
Does anyone know how to execute a stored preocedure using VBScript in ASP. The Stored Procedure returns two values indicating whether the insert has been successfull or not. I am currently up to the following and I am now officially stuck.
Code:
Dim cnSQL
Dim ResultInt
Dim Resulttxt
'All the usual database connection stuff here
'Call the stored procedure
cnSQL = "EXEC CPSDetailsAdd_Up '12345','Hello','G Day '," _
& ResultInt & "OUTPUT," & Resulttxt & "OUTPUT"
Conn.Execute(cnSQL)
Any help would be appreciated
-
i don't know if you can get a return value from a SP
this way,
but maybe to your case,
you can inspect the value in RecordsAffected to
see whether it succeeded or not.
hope it helps,
itay.
-
Records Affected
How do I inspect RecordsAffected
-
syntax:
connection.Execute CommandText, RecordsAffected, Options
RecordsAffected
Optional. A Long variable to which the provider returns the number of records that the operation affected.
exmaple:
dim myvar as long
myconn.execute "SPNAME", myvar
msgbox myvar
didn't test it though,
goodluck.
itay.
-
Stored Procedure
Hi
I now have my stored procedure working without handelling returned values. I have already tried what you suggested and couldn't get it to work.
Thanks for the help anyway. I will look into it further when I have more time stress levels are at an all time peak now.