ChrisBooth
Programmer
We have a COM application using VC++ objects to connect to SQL Server through MTS.
We now want to port this to Oracle. I have configured the software, correctly I think, and am having the following behaviour.
The first method called on start up is successful, the second method however fails. The difference is that the cursor opened in the first method is a Forward-Only cursor, but the second method uses a Static cursor. If I change the second method to be a Forward-Only cursor, it works fine. However I want to use the GetRecordCount function which is only valid in a static cursor.
Therefore do static cursors work in Oracle when configured with MTS?
Is there some specific configuration that I need to get these to run? - code below.
The error actually occurs when the GetRecordCount function is accessed and says cursor closed.
// Connect to DB
pConnection = new _ConnectionPtr(__uuidof(Connection));
db_man->OpenConnection(pConnection, lBusAreaID);
// Declare a recordset
pResults = new _RecordsetPtr(__uuidof(Recordset));
pResults->PutRefActiveConnection(pConnection);
// Retreive the recordset
pResults->Open(SQLString,
vtEmpty,
adOpenStatic,
adLockReadOnly,
adCmdText);
// Check the recordset
record_count = pResults->GetRecordCount();
We now want to port this to Oracle. I have configured the software, correctly I think, and am having the following behaviour.
The first method called on start up is successful, the second method however fails. The difference is that the cursor opened in the first method is a Forward-Only cursor, but the second method uses a Static cursor. If I change the second method to be a Forward-Only cursor, it works fine. However I want to use the GetRecordCount function which is only valid in a static cursor.
Therefore do static cursors work in Oracle when configured with MTS?
Is there some specific configuration that I need to get these to run? - code below.
The error actually occurs when the GetRecordCount function is accessed and says cursor closed.
// Connect to DB
pConnection = new _ConnectionPtr(__uuidof(Connection));
db_man->OpenConnection(pConnection, lBusAreaID);
// Declare a recordset
pResults = new _RecordsetPtr(__uuidof(Recordset));
pResults->PutRefActiveConnection(pConnection);
// Retreive the recordset
pResults->Open(SQLString,
vtEmpty,
adOpenStatic,
adLockReadOnly,
adCmdText);
// Check the recordset
record_count = pResults->GetRecordCount();