The return value is always blank, yet the inserts are happening.
Here is my stored procedure"
USE [stationdata]
GO
/****** Object: StoredProcedure [usrFireAdmin].[TMTC_SP_INSERT_USER] Script Date: 01/10/2012 07:07:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [usrFireAdmin].[TMTC_SP_INSERT_USER] (
@FirstName varchar(25),
@LastName varchar(25),
@Email varchar(90),
@password varchar(255)
)
as
SET NOCOUNT ON
insert into usrFireAdmin.TMTC_Users
(FirstName,
LastName,
EMAIL,
PASSWORD)
Values
(@firstname,@lastname,@password,@email)
--return IDENT_CURRENT('TMTC_Users')
return 99
Here is ther ASP Code:
<%
Const adParamReturnValue = 4
Const adInteger = 3
set cmdMain = Server.CreateObject("ADODB.Command")
Set objParameter = Server.CreateObject("AdoDB.Parameter")
Dim oConn, rs
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open connectionstring
sql = "exec TMTC_SP_INSERT_USER @FirstName='First1',@LastName='Last1',@Email='first.last@test.com',@password='password1'"
cmdMain.CommandText = sql
Set objParameter = cmdMain.CreateParameter("Return", adInteger,adParamReturnValue,,0)
cmdMain.Parameters.Append objParameter
cmdMain.ActiveConnection = oConn
Set rs = cmdMain.Execute
strUserID = cmdMain.Parameters(0)
Set rs = Nothing
Set oConn = nothing
Set cmdMain = nothing
%>
The New Users's ID is [ <%=strUserID%> ]
Any help would be appreciated. THANX !
Here is my stored procedure"
USE [stationdata]
GO
/****** Object: StoredProcedure [usrFireAdmin].[TMTC_SP_INSERT_USER] Script Date: 01/10/2012 07:07:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [usrFireAdmin].[TMTC_SP_INSERT_USER] (
@FirstName varchar(25),
@LastName varchar(25),
@Email varchar(90),
@password varchar(255)
)
as
SET NOCOUNT ON
insert into usrFireAdmin.TMTC_Users
(FirstName,
LastName,
EMAIL,
PASSWORD)
Values
(@firstname,@lastname,@password,@email)
--return IDENT_CURRENT('TMTC_Users')
return 99
Here is ther ASP Code:
<%
Const adParamReturnValue = 4
Const adInteger = 3
set cmdMain = Server.CreateObject("ADODB.Command")
Set objParameter = Server.CreateObject("AdoDB.Parameter")
Dim oConn, rs
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open connectionstring
sql = "exec TMTC_SP_INSERT_USER @FirstName='First1',@LastName='Last1',@Email='first.last@test.com',@password='password1'"
cmdMain.CommandText = sql
Set objParameter = cmdMain.CreateParameter("Return", adInteger,adParamReturnValue,,0)
cmdMain.Parameters.Append objParameter
cmdMain.ActiveConnection = oConn
Set rs = cmdMain.Execute
strUserID = cmdMain.Parameters(0)
Set rs = Nothing
Set oConn = nothing
Set cmdMain = nothing
%>
The New Users's ID is [ <%=strUserID%> ]
Any help would be appreciated. THANX !