if (szCode.length() > 0) { VARIANT varCode; ::VariantClear(&varCode); varCode.vt = VT_BSTR; varCode.bstrVal = szCode; //************************************************************************* // Following call pre-empts the query with "USE MyErrorDB;" which if uncommented // ensures the code is successful. //************************************************************************* // pTransactions->RefreshDatabaseContext (); //************************************************************************* // Query the table dbo_MyErrorDBTransaction with PK ReferenceNumber : // // Following statements produce the SQL Query which returns 1 row : // SELECT `ReferenceNumber`,`OiiCheckPoint`,`TransactionType`,`Status`,`TransactionDate`,`Portfolio1Code`,`Portfolio2Code`,`Date1`, // `Date2`,`Double1`,`Double2`,`Enum1`,`Enum2`,`Object1Type`,`Object1String1`,`Object1String2`,`Object1Date1`,`Object1Date2`, // `Object1Double1`,`Object1Double2`,`Object1Enum1`,`Object1Enum2`,`Object1Enum3`,`Object2Type`,`Object2String1`,`Object2String2`, // `Object2Date1`,`Object2Date2`,`Object2Double1`,`Object2Double2`,`Object2Enum1`,`Object2Enum2`,`Object2Enum3`,`Object3Type`, // `Object3String1`,`Object3String2`,`Object3Date1`,`Object3Date2`,`Object3Double1`,`Object3Double2`,`Object3Enum1`,`Object3Enum2`, // `Object3Enum3`,`Object4Type`,`Object4String1`,`Object4String2`,`Object4Date1`,`Object4Date2`,`Object4Double1`,`Object4Double2`, // `Object4Enum1`,`Object4Enum2`,`Object4Enum3`,`Comment`,`TransactionFee`,`Currency`,`CrossRate`,`LocalContact`,`CPContact`, // `CLientContact`,`Source`,`FCView`,`PortfolioPath`,`TotalHistoricalCost`,`Broker`,`InvestmentSubsRef`,`SubscriptionSeq`,`ImplementationID` // FROM MyErrorDB.dbo_MyErrorDBTransaction WHERE `ReferenceNumber` = '000100000_2004/10/5_4184948795/1' //************************************************************************** pTransactions->ClearSort(); pTransactions->ClearConditions(); pTransactions->AddANDFilter (0,varCode,""); pTransactions->ReadAllRows(); CTransactionRBRead * pRB; ADODB::_RecordsetPtr pRS(pTransactions->Recordset); IADORecordBindingPtr pBind(pRS); ADODB::EditModeEnum eme = ADODB::adEditNone ; pRB = new CTransactionRBRead(); FC_TESTHR(pBind->BindToRecordset((CADORecordBinding*)pRB)); while(VARIANT_FALSE == pRS->EndOfFile) { //---------------------------------- // Copies object properties to bound // pRB ADO derived class //---------------------------------- TransactionToRB(pT,*pRB); //---------------------------------- // RS Fields updated with the following call //---------------------------------- pRB->UpdateFields (pRS); try { //----------------------------------------- // This triggers E_FAIL generic HRESULT //----------------------------------------- pRS->Update(); } catch (_com_error& e) { //----------------------------------------- // Error specific info //----------------------------------------- HRESULT hr = e.Error(); // Error specific HRes = -2147352572 _bstr_t bstrSource(e.Source()); // Microsoft OLE DB Provider for ODBC _bstr_t bstrDescription(e.Description()); // As per error submission. } pRS->MoveNext(); l++; break; } if (l > 0) { pRS->Close(); if (!bCheckPointOperation) { LogSystemEvent( "Transaction updated.", 0.0, pTx->ReferenceNumber, (KFLBaseLib::EventLogItemEnum)5, KFLBaseLib::oTransaction, "TransactionFactory", pCurrentView->Description, (KFLBaseLib::I_Object *)pTx.GetInterfacePtr ()); if ((pTx->Action != taBorrow) && (pTx->Action != taLend)) { long l = pUF->MarkPerformanceAsDirty((KFLFactoriesLib::I_Object *)pTx->Portfolio1.GetInterfacePtr () ,pTx->TransactionDate,KFLFactoriesLib::rfUnspecified,KFLBaseLib::mmUnspecified); DropTxRateIntoDB(pTx); } } *pVal = TRUE; } else *pVal = FALSE; } return(S_OK);