Update of table does not return control

  • I am currently testing a piece of code that updates a table, but after a few (it varies between 4 and 12 executes) control is  not returned to the program.

    The fields are set up and then the following if statement

    if ( !m_pDoc->GetDataBase().UpdateTransactionStatus(recTransaction) )

    The Update of the Transactions table is set up as follows

    bool CEFTDb::UpdateTransactionStatus(const CEFTTransactions& recTransactions)

    {

    m_strQuery = "";

    m_strQuery.Format(EFT_TRANSACTIONS_UPDATE_STATUS,

    recTransactions.GetStatus(),

    recTransactions.GetConcatenate(),

    recTransactions.GetSig1(),

    recTransactions.GetSig2(),

    recTransactions.GetOperatorsID1(),

    recTransactions.GetID());

    DWORD dwCount;

    return ExecuteDirect(m_strQuery, dwCount);

    It is where it goes into the ExecuteDirect that it does not return!!

    The execute code :

    bool CSQLServerDb::ExecuteDirect(LPCSTR lpczCommand, DWORD& dwRowsEffected)

    {

        CCommand<CNoAccessor,CNoRowset,CNoMultipleResults> rs;

        // execute the command

        LONG nAmount = 0;

        HRESULT hr = rs.Open(m_Session, lpczCommand, NULL, &nAmount);

        if(FAILED(hr))

        {

            FormatOleDbError();

            return false;

        }

        if (nAmount > 0)

           dwRowsEffected = nAmount;

        else

           dwRowsEffected = 0;

       

        // nAmount <= 0 is also succesfull

        // Some SQL statements do not affect rows

        // like "begin transaction" & "commit transaction"

        return true;

    Does anyone have any idea why this would happen??

  • This was removed by the editor as SPAM

  • Olivia - could you please post your update statement as well as some sample rows from your table...

    Also, when you test this in QA does it work w/out errors ?!







    **ASCII stupid question, get a stupid ANSI !!!**

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply