I don't think you understand how a threaded query works: it is asynchronous, meaning it does not actually "happen" the moment you execute it. This means you cannot extract the data from it in the same function it is executed.
With your code, you would have to do the checking in the "SelectHandle" function, or move it back to non-threaded querying. The native to retrieve the data is SQL_ReadResult (there's also a field one that I can't remember).