HELP: "Invalid cursor state" when calling SQLExecDirect()

HELP: "Invalid cursor state" when calling SQLExecDirect()

Post by Ebbe Nilss » Tue, 21 Mar 2000 04:00:00



After calling SQLExecDirect() with a successful
UPDATE statement and SQLNumResultCols() to
determine column count (of course 0 here) I call
SQLCloseCursor() and SQLFreeStmt().

The following SQLExecDirect() with a SELECT...
results in an ODBC error "Invalid cursor state".  Why?
Have I missed something fundamental here?

Several SQLExecDirect with "SELECT ..." and subsequent
calls to SQLBindCol(), SQLFetch(), SQLCloseCursor() and
SQLFreeStmt()works fine.

I use SQL Server 7.0 w. driver 3.70 / ODBC 3.51

Thankful for any hints.
Please respond to this group.

Ebbe Nilsson, Minneapolis

 
 
 

HELP: "Invalid cursor state" when calling SQLExecDirect()

Post by Joe » Tue, 21 Mar 2000 04:00:00


Do you really need the SQLCloseCursor after the UPDATE?



> After calling SQLExecDirect() with a successful
> UPDATE statement and SQLNumResultCols() to
> determine column count (of course 0 here) I call
> SQLCloseCursor() and SQLFreeStmt().

> The following SQLExecDirect() with a SELECT...
> results in an ODBC error "Invalid cursor state". Why?
> Have I missed something fundamental here?

> Several SQLExecDirect with "SELECT ..." and subsequent
> calls to SQLBindCol(), SQLFetch(), SQLCloseCursor() and
> SQLFreeStmt()works fine.

> I use SQL Server 7.0 w. driver 3.70 / ODBC 3.51

> Thankful for any hints.
> Please respond to this group.

> Ebbe Nilsson, Minneapolis

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. SQL 7.0 error "Invalid Cursor State"

HI,

I'm developing a DB with SQL 7.0  I've created a table with an integer
field.  Every record has 0 in this field.  I've changed my mind and would
like to change the data type to decimal.  When I attempt to make this
change, I get the "Invalid Cursor State" error.  I've tried deleting the
field and recreating it, with the same result.  The DB and logs are well
below their maximum size limits.

What's going on? Do I need to delete the whole table and re-create it?

TIA,

Ron Walters

2. Data Secuirty Software

3. "Invalid cursor state" error

4. How to access a remote SQL database

5. "Invalid cursor state"

6. SQLDMO KillDatabase

7. ODBC "invalid cursor state"

8. ADO bug

9. "Invalid cursor state" / Error 0x80004005

10. SQLFetch after SQLExecDirect on SP=Invalid Cursor State [MSDN Subscriber]

11. Error "Bad cursor state"

12. "Cursor state not valid.", AS400 JDBC, IBM JTOpen 3.0