Error: [Microsoft][ODBC Driver Manager] Invalid cursor state

Anyone know what causes that error?
I can't see anything wrong in my code..