Click here to Skip to main content
16,008,183 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: WTL CString disaster !!! Pin
Christian Graus31-Mar-01 1:48
protectorChristian Graus31-Mar-01 1:48 
GeneralRe: WTL CString disaster !!! Pin
Anders Molin31-Mar-01 6:48
professionalAnders Molin31-Mar-01 6:48 
GeneralRe: WTL CString disaster !!! Pin
Michael Dunn31-Mar-01 7:56
sitebuilderMichael Dunn31-Mar-01 7:56 
GeneralRe: WTL CString disaster !!! Pin
Christian Graus31-Mar-01 12:47
protectorChristian Graus31-Mar-01 12:47 
GeneralGlobalFree Pin
Jamie Nordmeyer30-Mar-01 11:54
Jamie Nordmeyer30-Mar-01 11:54 
GeneralRe: GlobalFree Pin
Tim Deveaux30-Mar-01 13:31
Tim Deveaux30-Mar-01 13:31 
GeneralRe: GlobalFree Pin
Jamie Nordmeyer2-Apr-01 5:46
Jamie Nordmeyer2-Apr-01 5:46 
GeneralADO Problem Pin
#realJSOP30-Mar-01 9:57
professional#realJSOP30-Mar-01 9:57 
Visual C++ 6.0, sp5
NT4, sp5
(I also posted this on the ADO board)

I'm working on an app that uses ADO to access an oracle database. The following code is part of the function that opens a recordset (try/catch stuff removed for the sake of brevity):

Fields* m_pFields = NULL;
SAFE_CALL(m_piRecordSet->Open(vSQL, vConnection, adOpenDynamic, adLockOptimistic, adCmdText));
int m_nRecordCount = m_piRecordSet->GetRecordCount();
SAFE_CALL(m_piRecordSet->get_Fields(&m_pFields));


...and this is a code snippet from the function we use to close the recordset:

if (m_pFields)
{
    m_pFields->Release();
}
SAFE_CALL(m_piRecordSet->Close());
m_piRecordSet.Release();
m_piRecordSet = NULL;


The problem is with the m_pFields variable.

The first 10 or so times we call the function containing this code, it's a valid pointer. On or about the nth time, the variable is NULL. Actually "not initialized" would be a better description of it's state, because if we don't set it to NULL before calling the get_Fields() function, it's value is 0xcccccccc.

As far as I can tell, we close the recordset when we're done with it. Otherwise, we'd get an error message from Oracle saying we have too many open cursors.

Has anyone got any idea why this might be happening?
GeneralRe: ADO Problem Pin
Anders Molin31-Mar-01 6:52
professionalAnders Molin31-Mar-01 6:52 
GeneralHelp needed! Please help Pin
Mustafa Demirhan30-Mar-01 8:53
Mustafa Demirhan30-Mar-01 8:53 
GeneralRe: Help needed! Please help Pin
BenDev30-Mar-01 9:27
BenDev30-Mar-01 9:27 
GeneralProcedure/Function question Pin
Richard Cheng30-Mar-01 6:58
Richard Cheng30-Mar-01 6:58 
GeneralRe: Procedure/Function question Pin
Tim Deveaux30-Mar-01 7:17
Tim Deveaux30-Mar-01 7:17 
GeneralRe: Procedure/Function question Pin
Richard Cheng30-Mar-01 7:29
Richard Cheng30-Mar-01 7:29 
GeneralURGENT - Please Help! Pin
Mustafa Demirhan30-Mar-01 6:13
Mustafa Demirhan30-Mar-01 6:13 
GeneralRe: URGENT - Please Help! Pin
Masaaki Onishi30-Mar-01 6:45
Masaaki Onishi30-Mar-01 6:45 
GeneralWarnings compiling STL Pin
30-Mar-01 3:05
suss30-Mar-01 3:05 
GeneralRe: Warnings compiling STL Pin
Chris Losinger30-Mar-01 3:44
professionalChris Losinger30-Mar-01 3:44 
GeneralRe: Warnings compiling STL Pin
Anders Molin31-Mar-01 6:59
professionalAnders Molin31-Mar-01 6:59 
Generalsending messages from a worker thread to cdocument Pin
derhackler29-Mar-01 23:17
derhackler29-Mar-01 23:17 
GeneralRe: sending messages from a worker thread to cdocument Pin
markkuk30-Mar-01 0:09
markkuk30-Mar-01 0:09 
GeneralRe: sending messages from a worker thread to cdocument Pin
derhackler30-Mar-01 0:54
derhackler30-Mar-01 0:54 
GeneralRe: sending messages from a worker thread to cdocument Pin
BenDev30-Mar-01 3:03
BenDev30-Mar-01 3:03 
GeneralRe: sending messages from a worker thread to cdocument Pin
Ajit Jadhav30-Mar-01 6:47
Ajit Jadhav30-Mar-01 6:47 
GeneralRe: sending messages from a worker thread to cdocument Pin
derhackler30-Mar-01 6:50
derhackler30-Mar-01 6:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.