The Cursor is Already Open

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Posts: 18
Joined: Wed 11 Jul 2007 20:59
Location: Brazil

The Cursor is Already Open

Post by zedmartins » Thu 04 Oct 2007 21:29

Hello all,

I'm receiving this error after calling the Execute method of a TMSStoredProc component inside a COM+ ActiveX DLL.

Debugging the SDAC source I found the error inside a GetNextResult method.

It is a simple StoredProc... It only returns the result of a simple calculation using an OUT parameter... Why this MultipleResults thing? Why this GetNextResult is called?

Maybe it is related to COM+ threading model issues... Any help?

If I call the same stored procedure inside an .exe the error doesn't appear.

I'm using D5(upd) e SDAC

Thanks a lot,

Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Mon 08 Oct 2007 08:22

It is looks like one TMSConnection or TMSStoredProc object is used in different threads. You should create a separate components for the each thread.

If you often connect/disconnect to the server from different threads, you should enable pooling in your TMSConnections. For more information about pooling you can read in the SDAC help.

Post Reply