Below is a subset of my stored procedure (it does quite a bit more than this, but it has been snipped for space saving.CREATE PROC MaterialInsert @material nvarchar(25), @thick int, @colour nvarchar(25), @finish nvarchar(3), @substrate nvarchar(3), @manufact nvarchar(3), @descript nvarchar(50), @owner nvarchar(20)AS-- Declare all local variablesDeclare @ins_err int-- Start our transactionBEGIN TRAN-- Insert our new materialINSERT INTO Materials ( MaterialID, Thickness, ColourID, FinishID, SubstrateID, [Description], Owner, ManufacturerID)VALUES ( @material, @thick, @colour, @finish, @substrate, @descript, @owner, @manufact)-- Save the error code (just in caseSELECT @ins_err = @@Error----------------------------------------- Stuff deleted for berevity's sake ------------------------------------------- Check for valid SQL errorIF @ins_err = 0BEGIN COMMIT TRAN RETURN (0)ENDELSEBEGIN ROLLBACK TRAN RETURN( @ins_err )ENDGO
ASP Code Snippet:Dim dbConnDim rsConnSet dbConn = New Server.Object( "ADODB.Connection" )dbConn.Open( "Provider=sqloledb;<blargh>")strSQL = "MaterialInsert " & _ "@material=" & SQLquote(fldMaterial) & "," & _ "@thick=" & fldThickness & "," & _ "@colour=" & SQlquote(fldColour) & "," & _ "@finish=" & SQlquote(fldFinish) & "," & _ "@substrate=" & SQlquote(fldSubstrate) & "," & _ "@descript=" & SQlquote(fldDescription) & "," & _ "@owner=" & SQlquote(fldOwner) & "," & _ "@manufact=" & SQlquote(fldManufID) Set rsConn = dbConn.Execute( strSQL )
How am I able to get the return value from the above stored procedure?CheersRoger