All you have to do is execute the query and set its output to the recordset. On top of my head is something like this
Dim dbCon as new ADODB.Connection
Dim rst as new ADODB.Recordset
Dim cmd as new ADODB.Command
dbCon.ConnectionString="Your Connection String"
with cmd
.comandtype=adCmdStoredProc
.commandtext="Your SP name"
.Parameters.Append .CreateParameter("@Pram1", adVarChar, adParamInput, 50, "WhatEver")
.ActiveConnection=dbCon
.NamedParameters = True
Set rst = .Execute
end with
with rst
if .EOF=false then
myVar=!Column1
end if
end with
rst.close
dbcon.close
set cmd=nothing
source
share