BUG: Update Causes Degree of Derived Table Error

ID: Q196354

The information in this article applies to:

SYMPTOMS

When updating a recordset using Microsoft Foundation Classes (MFC) Database classes and a dynaset type cursor the following error may appear:

   Degree of Derived Table does not match column list.

This occurs when a table name is used as part of the column list in a SQL SELECT statement.

RESOLUTION

Do not use the table name as part of the fieldname in the SQL statement.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

MORE INFORMATION

The following snippet of code, using MFC ODBC, illustrates the use of table name that causes the error:

   CDatabase   Db;
   Rs2*      pRs;   //<-Derived CRecordset Class

   Db.Open("", FALSE, FALSE, "ODBC;DSN=OldOracle", FALSE );
   pRs = new Rs2( &Db );

   pRs->Open(CRecordset::dynaset, "SELECT AUTHORS.AU_ID, AUTHORS.AU_NAME,
                                   AUTHORS.PUB_ID FROM AUTHORS" );
   pRs->MoveLast();
   pRs->AddNew();
   pRs->m_AU_ID = "213-46-8915";
   pRs->m_AU_NAME = "Blender69";
   pRs->m_PUB_ID = "42";
   pRs->Update();
   pRs->Close();
   delete pRs;

   Db.Close();

Additional query words:
Keywords          : kbDatabase kbDriver kbODBC kbOracle 
Version           : WINDOWS:2.5
Platform          : WINDOWS
Issue type        : kbbug
Solution Type     : kbpending

Last Reviewed: December 1, 1998