Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Static ADO cursors in Oracle

Status
Not open for further replies.

ChrisBooth

Programmer
Sep 17, 2001
3
GB
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();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top