Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
zippy
Yak Posting Veteran
69 Posts |
Posted - 2001-10-24 : 20:09:26
|
| Hi,I have a sproc which should return an output paramater awell as a recordset.the recordset is coming back fine but I have no output value coming though :(here is the sproc:CREATE PROCEDURE bbSelectTopic@TopicID INT,@Title VARCHAR(100) OUTPUTASSELECT @Title = Title FROM bbTopics WHERE TopicID = @TopicIDSELECT bbMessages.UserID,gnUsers.ScreenName,bbProfiles.Title,bbProfiles.Signature,bbMessages.PostDate,bbMessages.MessageFROM bbMessages INNER JOINgnUsers ON gnUsers.UserID = bbMessages.UserID INNER JOINbbProfiles ON bbProfiles.UserID = gnUsers.UserIDWHERE TopicID = @TopicIDGOWhen I execute it in query analyser the value Title is returned.I think the problem must be in my asp,this is what I am using:Set cmd = Server.CreateObject("ADODB.Command") with cmd .ActiveConnection = cnAdmin .CommandText = "bbSelectForums" .CommandType = adCmdStoredProc .CommandTimeout = 0 .Parameters.Append .CreateParameter("ForumID",adInteger,adParamInput, , ForumID) end with Set rs = Server.CreateObject("ADODB.Recordset") rs.Open cmd if rs.EOF then Results = 0 else Results = 1 arrForums = rs.GetRows() end if Set rs = nothingRemoveAllParameters(cmd) with cmd .ActiveConnection = cnAdmin .CommandText = "bbSelectTopic" .CommandType = adCmdStoredProc .CommandTimeout = 0 .Parameters.Append .CreateParameter("TopicID",adInteger,adParamInput, , TopicID) .Parameters.Append .CreateParameter("Title",adVarchar,adParamOutput,100, Title) end with Set rs = Server.CreateObject("ADODB.Recordset") rs.Open cmd Title = cmd.Parameters("Title") if rs.EOF then Results = 0 else Results = 1 arrTopics = rs.GetRows() end if Set rs = nothingSet cmd = nothingI am pretty sure that I have screwed that asp bit up,I have tried what I though would work a number of different ways to no avail.Please help me :)Check out the worlds fastest computers at http://www.ocgurus.com |
|
|
|
|
|
|
|