Calling SQL Stored Procedure with Output Parameter in VBScript

前端 未结 1 1596
萌比男神i
萌比男神i 2021-01-12 12:43

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

1条回答
  •  旧巷少年郎
    2021-01-12 13:15

    You should return the value of your output parameter:

    checkAccess = cmd.Parameters("@IsAllowed").Value
    

    Also, output parameters in ADO don't require an initial value and adBoolean parameters don't require a size, so you could change your the last paramter to:

    cmd.Parameters.Append(cmd.CreateParameter("@IsAllowed", adBoolean, adParamOutput))
    

    You could also get rid of your isAllowed variable since it is no longer necessary.

    0 讨论(0)
提交回复
热议问题