Calling SQL Stored Procedure with Output Parameter in VBScript


I have written a VBScript function to call a stored procedure. In the past I have written a number of functions calling stored procedures with input parameters but in this instance I want to work with an o/p parameter.
In other app I call the ditto similar stored procedure using the Entity Framework so the stored procedure is good.
this is my code snippet snippet:
Function checkAccess(userid link)
isAllowed = false
set cmd = Server.CreateObject("ADODB.Command")
cmd.CommandText = "Check_Permission"
cmd.ActiveConnection = Conn
cmd.NamedParameters = true
cmd.CommandType = adCmdStoredProc
cmd.Parameters.Append(cmd.CreateParameter("@Login" adVarChar adParamInput 50 userId))
cmd.Parameters.Append(cmd.CreateParameter("@LinkId" adInteger adParamInput 50 link))
cmd.Parameters.Append(cmd.CreateParameter("@IsAllowed" adBoolean adParamOutput 10 isAllowed))
checkAccess = isAllowed
End Function

This function generally returns false. How can i make it work?



Get Source Code

  Views 292   Posted on : Friday, March 22, 2013 12:22:44 PM
Related Tags:




Replies on "Calling SQL Stored Procedure with Output Parameter in VBScript" :

Nobody has replied on this post , be first to post answer.


Post Your Answer/Comment:

Please Login first to post Reply !


Note: Please Put Code into <code></code> block.




Also See: