If inside a stored procedure, there a SELECT statement to return a recordset
and another SELECT to set the value of an output parameter (as in SELECT
@OutValue = Name FROM table WHERE pkid=5), would 2 execute statements be
needed to return the OUTPUT parameter?
Like this?
adocmd.CommandT imeout = 120
adocmd.ActiveCo nnection = conn
adocmd.CommandT ype = adCmdStoredProc
adocmd.CommandT ext = "dbo.sprMyProce dure"
' write to database using spr
With adocmd
set param = .CreateParamete r("@Value1", adInteger, adParamInput, 4, 15)
.parameters.app end param
set param = .CreateParamete r("@Value2", adInteger, adParamInput, 4, 19)
.parameters.app end param
set param = .createparamete r("@OutValue" , adVarChar, adParamOutput, 50)
.parameters.app end param
set rs = .execute
.execute
MyValue = .Parameters("@O utValue").Value
And, for that matter, how would I open the recordset so that it may be
restarted with
rs.MoveFirst
without getting
error '80040e18'
Rowset position cannot be restarted.
and, as well be able to retrieve the number of rows with rs.Recordcount ?
--
Thank you,
Julian