title: Calling SQL Stored Procedure with Output Parameter in VBScript
body: <p>I've written a VBScript function to call a stored procedure.  In the past, I've written a number of functions calling stored procedures with input parameters, but in this instance, I need to work with an Output parameter.</p>
  
  <p>In another application, I call the exact same stored procedure using the Entity Framework, so the stored procedure is fine.</p>
  
  <p>Here's my code:</p>
  
  <blockquote>
  <pre><code>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
  </code></pre>
  </blockquote>
  
  <p>This function always returns false.  How do I make it work?</p>