标签:
1.设置 pRecord->CursorLocation = adUseClient;
2.open方法中设置lockType 为adLockBatchOptimistic
_RecordsetPtr pRecord; pRecord.CreateInstance("ADODB.Recordset"); pRecord->CursorLocation = adUseClient; CString strSQL ; strSQL.Append("SELECT * fROM emp "); try { pRecord->Open(_bstr_t(strSQL),pConnection.GetInterfacePtr(),adOpenStatic,adLockBatchOptimistic,adCmdText); CString strValue; while(!pRecord->AdoEOF) { strValue.Format("Test_%d",pRecord->AbsolutePosition); pRecord->PutCollect("name",_variant_t(strValue)); pRecord->MoveNext(); } pRecord->UpdateBatch(adAffectAll); pRecord->Close(); } catch(_com_error &e) { OutputDebugString(e.Description()); }
ADO Recordset 对象中的updateBatch函数的使用方法(转)
标签:
原文地址:http://www.cnblogs.com/it-duit/p/5828585.html