in reply to ODBC error message

From the error, I'll wager it is actually your code. Unfortunately, you didn't provide any of it for us to look at.

I see a couple solutions, (A) Flush the remaining results from the previous query or (B) open another connection to the database.