The option I used in the past is to create a temp table before calling the stored proc that uses it. As long as you use the same open adodb connection , it should work:
myAdoDBConn.Execute "CREATE TABLE #foo (ID integer)", , adCmdText myADODBConn.Execute "StoredProcThatPopulatesFoo", , adCmdStoredProc myAdoRecordset.Open "Select ID FROM #foo", myAdoDbConn, adOpenForwardOnly, adLockReadOnly Do While Not myAdoRecordset.EOF
In this example, the temp table remains available until you close the connection ( myAdoDbConn ).
source share