Using MSSQL 2k vb6/classic ado. I've search everywhere for a simple answer to this question from these forums to google. I have a simple sproc on my server with syntax as follows:I don't want to create a recordset I just want the return value of field 'Val11' from my select statement. I can execute this in Query Analyzer and get the value for 'Val11'. How can I do this with ado? All I get is the @Return_Value which is 0 of course. I just want the stored procedure to return the value from my Select statement without creating a recordset object. Here is the code that executes the sproc from within vb.Code:CREATE PROCEDURE [stp_Stop9Stat] AS SELECT Val11 FROM tblConveyorB3 WHERE(Id=27) GOI know this is simple, but I can't seem to retrieve the value unless I build a recordset and set it to the Execute statement of my sproc? Am I looking at this wrong or can't I return a value from a sproc without using a recorset?Code:Dim objCmd As New ADODB.Command With objCmd .CommandText = "stp_Stop9Stat" .ActiveConnection = DbSQLConn .CommandType = adCmdStoredProc .Execute End With
-jon





Reply With Quote