Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Newbie question on ADO programming in C/C++ regarding performance

Newbie question on ADO programming in C/C++ regarding performance

From: Chung Ta <ktdta_at_shaw.ca>
Date: Wed, 01 Jan 2003 18:33:09 GMT
Message-ID: <FvGQ9.333533$ka.8478355@news1.calgary.shaw.ca>


Hi

I am having a problem on the performance of a particular query against an oracle database based on ADO programming model.

I issue the exact query statement against the the oracle database via the SQL*Net 32 command tool without any problem on the performance (at least 10 times as fast). So I know that this is not about the query itself. Through debugging session, I noticed that the call "while ( !pRs->GetadoEOF())" was the culprit. I am guessing that the problem lies in the way I code (due to my lack of the understanding about ADO). Upon a successful openning of the recordset, I understand that the cursor is placed at the beginning record, but I don't know why it takes sol long to test the end of the condition at the beginning of the while loop. It appeared as if the cursor is rotated around the recordset. Could someone look at the code and give me any suggestion to improve the performance.

Tools: Visual studio 6.0 on W2K machine (ADO 1.5) (Oracle driver 7.3 Ver 2.5)
Thank you very much

Chung Ta

.... Make the connection
....

  hr = pgblConn.CreateInstance(__uuidof(Connection));   pgblConn->ConnectionString = "DSN=mydsn; UID=myid;PWD=mypassword;";   pgblConn->Open("","","", -1)
....

hr = pRs.CreateInstance(__uuidof(Recordset));
....
....Building the source "select" statement
....

 pRs->Open(Source,pgblConn.GetInterfacePtr(),adOpenForwardOnly,

                                    adLockReadOnly,adCmdUnknown);
 .... data variable initialization

  while ( !pRs->GetadoEOF()) {

        ...
       ...Retrieve the data... and perform some data logic
        ...

    pRs->MoveNext();
 }

 pRs->Close(); Received on Wed Jan 01 2003 - 12:33:09 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US