"no open cursor or cursor closed" when using Addnew for Remote Data Objects 
Author Message
 "no open cursor or cursor closed" when using Addnew for Remote Data Objects

I get the error "no open cursor or cursor closed" on the last line in
the following code:

Set WS = rdoEngine.rdoEnvironments(0)
Set DB = WS.OpenConnection("Access Files")
Set RS = DB.OpenResultset("Delete * From tblImportTable", rdOpenDynamic)

RS.AddNew

I'm pretty new to VB and databases and am confused if this is happenning
becuase of the "rdOpenDynamic" parameter or not.. I'm just trying to add
a new record to my table.  Any help would be appreciated.

Kushal Khan



Mon, 27 Nov 2000 03:00:00 GMT  
 "no open cursor or cursor closed" when using Addnew for Remote Data Objects

A DELETE is an action query: it doesn't really create a resultset. Use
the rdoConnection's Execute method to run action queries.

If you want to use AddNew-Update to insert rows, you need to create a
resultset using something like "SELECT * FROM tblImportTable".

Personally, I prefer using INSERT queries to add rows (again, using the
Execute method), but to each his/her own.

Quote:

> I get the error "no open cursor or cursor closed" on the last line in
> the following code:

> Set WS = rdoEngine.rdoEnvironments(0)
> Set DB = WS.OpenConnection("Access Files")
> Set RS = DB.OpenResultset("Delete * From tblImportTable", rdOpenDynamic)

> RS.AddNew

> I'm pretty new to VB and databases and am confused if this is happenning
> becuase of the "rdOpenDynamic" parameter or not.. I'm just trying to add
> a new record to my table.  Any help would be appreciated.

> Kushal Khan



Tue, 28 Nov 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. "Open cursor not closed"

2. No Open Cursor or Cursor Closed

3. CommitTrans Problem...(Error Msg:No open cursor or cursor closed)

4. Sybase/VB - 40088 No cursor open or cursor closed w/ stored procs

5. CommitTrans Problem (No open cursor or cursor closed)

6. How to resolve "no open cursor or cursor closed" error message

7. "No open cursor or cursor closed" error

8. Cursor = "wait"

9. Error "The cursor was not declared"

10. Help "Tracking the Cursor"

11. "Processing" cursor (i.e., hourglass)

12. data environment connection will not "close"

 

 
Powered by phpBB® Forum Software