Microsoft KB Archive/187378

= BUG: DoBulkFieldExchange Not Called for MFC Recordset Class =

Article ID: 187378

Article Last Modified on 11/21/2006

-

APPLIES TO

 Microsoft Foundation Class Library 4.2, when used with:  Microsoft Visual C++ 5.0 Enterprise Edition

 Microsoft Visual C++ 5.0 Professional Edition 

-



This article was previously published under Q187378



SYMPTOMS
An invalid number of parameters or an assertion can occur when you attempt to open a CRecordset derived class.



CAUSE
The MFC Recordset class binds parameters to member variables by calling the DoFieldExchange member function. When you use bulk row fetching, the binding is done by calling the DoBulkFieldExchange member function. However when you bind parameters, MFC calls a common function, BindParams, to perform the binding in either case. There is currently a bug with BindParams in that it does not check to see if bulk row fetching is being used and does not implement DoBulkFieldExchange for binding parameters.



RESOLUTION
The best workaround for this problem is to have DoFieldExchange call DoBulkFieldExchange explicitly, as in the following example: void CBulkRecordSetSample::DoFieldExchange(CFieldExchange* pFX) {    DoBulkFieldExchange(pFX); }

<div class="status_section">

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

<div class="references_section">