Invalid Cursor State Error
Keywords: statement handle and invalid cursor state
Question:
I have a problem wiht Update Statmants within the ODBC Extender. My Select Query is like this:groups = qExecDirect(hstmtgrp,"SELECT * FROM %TableNameGroupDB% WHERE USERNAME = '%username%'")works without any problems. But a Statement like:retcode = qExecDirect(hstmtusr,"UPDATE UserDB SET CreateUser=0")does not work. The same statement defined in Access97 works fine!The ErrorMessage I get is:
24000 [Microsoft][ODBC Driver Manager] Invalid cursor stateI get this error every time no matter how i format the Statement.Can anybody help me??
Answer:
You cannot reuse the Statement Handle when the cursor is in use in this memory table. Take a look at the function qFreeStmt. Try one of the following to free up a stmt handle:;SQL_CLOSE - FREES A SQL CONNECTION qFreeStmt(hstmt, 0) ;or ;SQL_UNBIND qFreeStmt(hstmt, 2)
Article ID: W12535Filename: Invalid Cursor State Error.txt