CDaoRecordset::Update Problems 
Author Message
 CDaoRecordset::Update Problems

Hi,
     I'm trying to ad records to a CDaoRecordset using the
AddNew()...Update() methodolog.  It looks something like this:

        m_pRS->AddNew();

        m_pRS->m_szField1 = "whatever";

        m_pRS->Update();

As soon as Update is called, an "Item not found in this collection"
exception is thrown.  I should note that I am able to access the table in
the database which I'm interested in using the Move...() functions and
looking at the member variables in the CDaoRecordset.  

Does anyone know what's wrong?  This is happening on both my real program
and a test program I threw together to try to figure out what's happening.

Martin Roesch



Sun, 18 Jul 1999 03:00:00 GMT  
 CDaoRecordset::Update Problems

Hi again everyone,
     I found the answer to the problem, it turns out it's a bug in MFC 4.0.
 You need to strip the square brackets off of the names that App Wizard
puts into the program when it generates the DFX stuff.  There is a KB
artical which covers the whole thing at

        http://www.microsoft.com/kb/articles/q148/8/48.htm

so if you're having the same problem, that's the place to go.

Martin Roesch


Quote:
> Hi,
>      I'm trying to ad records to a CDaoRecordset using the
> AddNew()...Update() methodolog.  It looks something like this:

>    m_pRS->AddNew();

>    m_pRS->m_szField1 = "whatever";

>    m_pRS->Update();

> As soon as Update is called, an "Item not found in this collection"
> exception is thrown.  I should note that I am able to access the table in
> the database which I'm interested in using the Move...() functions and
> looking at the member variables in the CDaoRecordset.  

> Does anyone know what's wrong?  This is happening on both my real program
> and a test program I threw together to try to figure out what's
happening.

> Martin Roesch




Sun, 18 Jul 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. CDaoRecordset::Update Problem

2. CDaoRecordSet -- CDaoRecordSet -- CDaoRecordSet

3. Data after CDaoRecordset::Update()?

4. CDaoRecordset Update returns false

5. How to use CDAORecordSet to update database?

6. DAO3.60 - getting error 3260 when doing CDaoRecordset::Update

7. How to use CDAORecordSet to update database?

8. CDaoRecordset.Update() is messing up GetFieldValue return

9. CDaoRecordset Not updating correctly

10. CDaoRecordset::Update()

11. Problem with SQL statement to open derived CDAORecordset

12. CDaoRecordSet Problem

 

 
Powered by phpBB® Forum Software