Without some sort of sample code, my guess would be that your cursor isn't declared as a global cursor, and you're having scope issues trying to access it from different routines.
Grim
(aka Toby)
MCDBA, MCSD, MCP+SB
Need a Second Life?
Sounds more like a C++ issue than a SQL, ADO or ADO.NET issue, unless SQL Server itself is giving this error. Your C++ code is probably overrunning a stack-based buffer. Stability. What an interesting concept. -- Chris Maunder
Ensure that every use of BEGIN TRAN is matched with either a ROLLBACK TRAN or a COMMIT TRAN, regardless of whether an error occurs. In the case of a fatal error, SQL Server will roll back any transactions before it closes your connection. If you have implicit transactions enabled (through SET IMPLICIT_TRANSACTIONS ON) a BEGIN TRAN happens automatically the first time you perform any data modification operation. You still have to commit or roll-back this implicit transaction explicitly. Stability. What an interesting concept. -- Chris Maunder