"Invalid cursor state" / Error 0x80004005

"Invalid cursor state" / Error 0x80004005

Post by Travis McGe » Tue, 09 Jan 2001 20:47:50

I have a routine as follows, which helps me to do query governing for a very
large database with free adhoc capability with web front end.
Below routine used to work on all IIS5 machines with Win2000 server with
sp1, MDAC 2.5.   Gradually it started not working on certain machines.
The issue is that at
    Set rsC = oCmdCost.Execute          line I get
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80004005)
Invalid cursor state
/personSearchus.asp, line 27

Server};Connect Timeout=300;General Timeout=300;"
Set oConnCost = CreateObject(sCn)
oConnCost.Open sConnCost
oConnCost.CursorLocation = 3 :
Set oCmdCost = CreateObject(sCmd): oCmdCost.ActiveConnection = oConnCost
oCmdCost.CommandTimeout = 180 :
oCmdCost.CommandText = "set showplan_all off"
Set rsC = oCmdCost.Execute
oCmdCost.CommandText = "set showplan_all on"
Set rsC = oCmdCost.Execute
sSql =  "select distinct  top 500 idField from myTable where firstName
='jacko' and state = 'CA' and lastName like = 'K%'
oCmdCost.CommandText = sSql
oCmdCost.CommandType = 1
oCmdCost.prepared = false
Set rsC = oCmdCost.Execute
iCostRows = clng(rsC("EstimateRows"))

Heeeeeeeeeelp please.
What is file+version is causing this error.

Travis McGee
Nothing But Microsoft


1. SQL 7.0 error "Invalid Cursor State"


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?


Ron Walters

2. SQLXML3.0 SOAP Doesn't work

3. "Invalid cursor state" error

4. FT Informix job in Denver!

5. "Invalid cursor state"

6. Extent is linked in more than one chain

7. ODBC "invalid cursor state"

8. Convert LONG to CLOB (8i)

9. Error "Bad cursor state"

10. "Invalid Cursor Error"

11. Stream.Open have error "0x80004005"!!

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