Re: SQL Update: How do I get more error information

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Bob,

Sorry I took so long in responding. Had other priorities to deal with. I'm
back on this problem now.

The data base is a MS Access. The code is an app in C++ thats runs on a PC.
No web code involved.

Below is the main piece of code in question. The AddRecord method does an
update also ( which works fine) just before exit of its method. If the method
below is called to update and existing record it works fine. If its a new
record then it fails. I've trace thru the code and there is no sign of
problem. The bookmark looks good and the GetRecord returns the record to be
updated okay. I have an earlier version that has this same code as well as
the methods that are called. It traced them side by side and one works and
this one fails.


Any ideas?????

Thanks for all your help,
Neil

The server is "Microsoft.Jet.OLEDB.4.0".
The recordset is .....adOpenDynamic, adLockOptimistic, adCmdText.....


***************************************************
//************************************************************************************
void CReporterView::PutRecordToDatabase(int row)
//************************************************************************************
{
CRecord *pRecord, tempRecord;
CAccountDataBindingADO* pRsRecord;
CRecordSet* pAccountRs;
int r=row;

// Record set for Transaction view
if (IsTransactionView())pAccountRs=bDB.GetRecordSet("ItemView");

// Record set for AccountJournalProject view
else pAccountRs=bDB.GetRecordSet("AccountView");


// Write it back to the database - if it was changed
if (m_view[r]->m_dirty)
{
// Get the record
pRecord=m_view[r];

// Add the record to the data base - if it's a new record
if (pRecord->m_newRecord)
{
pRsRecord=(CAccountDataBindingADO*)pAccountRs->GetRecord();
pAccountRs->AddRecord();
pRecord->m_id=pRsRecord->m_id;
pAccountRs->GetBookmark(pRecord->m_bookmark);
pRecord->m_newRecord=false;
}

// Get the record to be updated
pRsRecord=(CAccountDataBindingADO*)pAccountRs->GetRecord(pRecord->m_bookmark);

// Get the record and create a temporary copy of it
tempRecord=*pRecord;

// Swap accounts - if necessary
if (tempRecord.IsSwapped()) tempRecord.SwapPrimaryAndSecondaryAccounts();

// Write to the database
*pRsRecord=tempRecord;
pAccountRs->UpdateRecord();

// Reset the dirty record flag
pRecord->m_dirty=FALSE;
}
}
***************************************************

"Bob Barrows" wrote:

Neil B wrote:
I got the following error information when updating a record to the
database. The connection error count was only 1. So how do I get more
information about the error so it can be debugged? Where are the
status values?

Thanks, Neil

"Function: CRecordSet::UpdateRecord, RecordSet: AccountView
Error# = -2147217887, Multiple-step operation generated errors.
Check each status value., (Source: Microsoft Cursor Engine), (SQL
State: (null)), Native Error: 0"

Unfortunately, that is the error that ADO reports when it does not know what
to report. I have run into that error many times, and each time it has had a
different cause.

What is this? A server-side cursor? It looks like SQL Server is the
underlying rdbms. What version?

Without information about how to reproduce the error we don't have much
chance of helping you. My first step would be to use SQL Profiler to trace
what's going on when performing the steps to reproduce the problem.


--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



.



Relevant Pages

  • Re: Max number of threads that can be used?
    ... you are polling for an other process deleting a row in the database. ... > One big sql ... If you have inserted 10 rows in the data base and you are waiting for this 10 rows to become deleted, don't ask the data base 10 times. ... I have anough work to do. ...
    (comp.programming.threads)
  • restore sql 2000 bu file to sql 2008
    ... Hi i want to move my data base from sql 2000 to my new computer with ... i backed up my data base in sql 2000 and i got a file with .bu ... but when i tried to restore it. ... "The back up set hods a backup of a database other than existing ...
    (microsoft.public.sqlserver.setup)
  • Re: data base & Machine Language
    ... 4)what is the best book for data base in c programing? ... various relevant database API's ... general database and SQL ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SharePoint/SQL question
    ... It's only a very wild guess, but could it be that you have SharePoint Timer ... All of my SharePoint web data is stored in an SQL ... (meaning the SQL database and the site in IIS). ... The data base that the error is referring to has been removed from SQL by ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: If you were inventing CoBOL...
    ... The software that started life as Burroughs DMSII back in the very early ... Systems -- almost certainly predated IDMS, and in my opinion, throughout its ... It's now called "Database Server for ClearPath MCP ... just as you have the ability to declare a data base with the most horrendous ...
    (comp.lang.cobol)