Stack Overflow on Insert

Jeff Nygren <[email protected]> Thu, 23 May 2002 09:50:19 -0500
Newsgroups gmane.comp.windows.devel.oledb.devel
Message-ID <[email protected]>
I sent this to the list yesterday, but it looks like it bounced. If you
have already seen this message, please ignore this copy.

Jeff Nygren

----- Forwarded by Jeff Nygren/US/DataCard on 05/23/02 09:48 AM -----

I have some code that adds records to a MS Access database. If I try to
add too many records, I get a stack overflow. I'm guessing there is
something more I need to do, but I don't know what it is. My code is
basically:

CDataSource_Object.OpenFromInitializationString(sInitString);
CSession_Object.Open(CDataSource_Object);

CCommand<CManualAccessor>  CCommand_Object;
CCommand_Object.CreateAccessor(nCols, &pBuffer, nBufferSize);
for (... nCols ...)
   CCommand_Object.AddBindEntry(col, type, size, ptr);
CCommand_Object.Open(CSession_Object, sQuery, &Updatability_PropSet);

for (... nRows ...)
{
   LoadAccessorBuffers();
   CCommand_Object.Insert();
}

CSession_Object.Close();
CDataSource_Object.Close();


The program runs correctly as long as I don't reach the point of
overflowing the stack. The number of rows I can insert depends on size and
number of columns and on stack size.  Is there some kind of 'flush' I need
to add after the Insert()? If my pseudo-code is to cryptic to understand,
I have a sample project I could send.

Any help you can offer will be greatly appreciated. I am an experienced
programmer, but a database novice.

Thanks.

Jeff Nygren