If you look online at the documentation for SQLPrepare under the error for "invalid cursor state", you'll see this explanation:
"(DM) A cursor was open on the StatementHandle, and SQLFetch or SQLFetchScroll had been called.
A cursor was open on the StatementHandle, but SQLFetch or SQLFetchScroll had not been called."
It sounds as if you're screwed either way...
Can anyone please tell me what that's supposed to mean??