December 7, 2005 at 3:12 am
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??
December 12, 2005 at 8:00 am
This was removed by the editor as SPAM
December 13, 2005 at 8:19 am
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