Problem in UpdateBatch of ADO Recordset 
Author Message
 Problem in UpdateBatch of ADO Recordset

Hi

        I am getting a error
'The specified row could not be located for updating: Some values may have
been changed since it was last read"
This scenario is single-user . No other user is connected to the database

The code is as follows

sprintf(buf,"select exgid,cntid,dfdate,df from evalperiodsdata where exgid =
'%s' and cntid = '%s' order by dfdate",szExgid,szCntid);
 try{

pUlyCnt->Open(_bstr_t(buf),m_pConn.GetInterfacePtr(),adOpenStatic,adLockBatc
hOptimistic,adCmdText);
    if(!pUlyCnt->BOF)
       pUlyCnt->MoveFirst();
    else
    {
     pUlyCnt->Close();
    return;
    }
     while(!pUlyCnt->adoEOF)
    {
      v_Date = pUlyCnt->Fields->GetItem("DFDATE")->Value;
      double nDf = ptrDFCurve->GetDiscountFactorFromCurve(v_Date.lVal);
         pUlyCnt->Fields->GetItem("DF")->Value = _variant_t(nDf) ;
         pUlyCnt->MoveNext();
    }
     pUlyCnt->UpdateBatch(adAffectAll);
     pUlyCnt->Close();

Quote:
}

catch(_com_error &e)
{
  TRACE ( e.Description());

Quote:
}

Can you pls tell me a solution to this problem

Thanks in Advance.

Regards
Vijay



Thu, 07 Jul 2005 19:33:06 GMT  
 Problem in UpdateBatch of ADO Recordset
Do you check the the SQL statement is correct even in your SQL query tools?
There is KB for Update Criteria and you can refer to this article.

HOWTO: Control Your Updates in ADO Through "Update Criteria": Q190727

Summary
The ADO Client Cursor Engine allows you to control how it builds the action
queries that update the database according to the changes you make to the
recordset object. This article is designed to help you understand how to
control how ADO performs these updates.

Best Regards

Jian Shen
This posting is provided "AS IS" with no warranties, and confers no rights.



Fri, 08 Jul 2005 11:20:51 GMT  
 Problem in UpdateBatch of ADO Recordset

Thanks


Quote:
> Do you check the the SQL statement is correct even in your SQL query
tools?
> There is KB for Update Criteria and you can refer to this article.

> HOWTO: Control Your Updates in ADO Through "Update Criteria": Q190727

> Summary
> The ADO Client Cursor Engine allows you to control how it builds the
action
> queries that update the database according to the changes you make to the
> recordset object. This article is designed to help you understand how to
> control how ADO performs these updates.

> Best Regards

> Jian Shen
> This posting is provided "AS IS" with no warranties, and confers no
rights.



Fri, 08 Jul 2005 14:47:54 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Problem with ADO recordsets of recordsets under MTS

2. Reducing trips to db with Recordset -> UpdateBatch

3. ADO UpdateBatch Fails

4. Speed of ADO Recordset vs ADO Command in VC

5. ADO.Stream and ADO.RecordSet

6. Problems getting values from ADO Recordset

7. Problem with IDL for COM server returning ADO disconnected Recordset

8. Returning ADO Recordset Problem

9. ADO Recordset Delete problem

10. Problem with ADO Recordset

11. Problem Converting ADO Recordset to XML

12. ADO Recordset problem

 

 
Powered by phpBB® Forum Software