SuperCyber
Programmer
My problem is that I get a -1 returned to my ASP page from my SP, but in the Query Analyzer it works properly. Basicly I am just returning the code and writing the response until I figure this out. Below I have listed the SP (Thanks to Terry Broadbent) and my ASP code. Any help is greatly appreciated.
Alter Procedure sproc_getAdmin @ID int
AS
DECLARE @Admin Int
SELECT @Admin=
Case empAdmin
When 'Yes' Then 1 Else 0 End
FROM tblEmployees
WHERE empID=@ID
RETURN @Admin
*********************************************************
** strUserID pulls the EmpID from the Session object.
Dim lngID, cmdGetAdmin, prm, varReturn
lngID = strUserID
Set cmdGetAdmin = Server.CreateObject("ADODB.Command"
Set cmdGetAdmin.ActiveConnection = connAPS
cmdGetAdmin.CommandType = adCmdStoredProc
cmdGetAdmin.CommandText = "sproc_getAdmin"
Set prm = cmdGetAdmin.CreateParameter("@ID",adInteger,adParamInput,,lngID)
cmdGetAdmin.Parameters.Append prm
cmdGetAdmin.Execute varReturn
Response.Write varReturn
Thanks,
Brian
Alter Procedure sproc_getAdmin @ID int
AS
DECLARE @Admin Int
SELECT @Admin=
Case empAdmin
When 'Yes' Then 1 Else 0 End
FROM tblEmployees
WHERE empID=@ID
RETURN @Admin
*********************************************************
** strUserID pulls the EmpID from the Session object.
Dim lngID, cmdGetAdmin, prm, varReturn
lngID = strUserID
Set cmdGetAdmin = Server.CreateObject("ADODB.Command"
Set cmdGetAdmin.ActiveConnection = connAPS
cmdGetAdmin.CommandType = adCmdStoredProc
cmdGetAdmin.CommandText = "sproc_getAdmin"
Set prm = cmdGetAdmin.CreateParameter("@ID",adInteger,adParamInput,,lngID)
cmdGetAdmin.Parameters.Append prm
cmdGetAdmin.Execute varReturn
Response.Write varReturn
Thanks,
Brian