I am trying to access a SQL stored procedure(sp) which creates a local temp table and then queries it.
My vb code can access the first recordset(created from a insert into statement to a #temp table) but then the second recordset (a select distinct from #temp table, queried within the same sp) gives a 'Invalid object name' error after the rs.nextrecordset command.
I have been looking for ages in forums and no specific answers seem to exist.
I am aware that the #temp table only exists in its own scope, but should this not be deleted when you close the connection to the database and be available until that time?

Please help if you can, my headache may disappear!!

Many thanks in advance.