How to use CDaoRecordset::AddNew to create new records 
Author Message
 How to use CDaoRecordset::AddNew to create new records

I am trying to add several new records to various tables that I have created
via an Access Database (Access 97).

From what I read, it seems the CDaoRecordset table must be opened prior to
using AddNew.

This I see as a problem as I want to add several records to several tables,
does this mean I have to open each table with a Query? (I don't know of any
other way of opening a CDaoRecordset).

Is there a simple way to "open" a CDaoRecordset so I can add a new record.
I think it would be very hacky to have to call a "NO-OP" query just to open
the table.  I don't want to have class-global variables holding open
CDaoRecordset table pointers either.

Please cc: any replies to my email address as I don't read this group every
day.

Thanks,

--
Remove *REMOVE* to email
Tom Dietz



Sat, 22 Jul 2000 03:00:00 GMT  
 How to use CDaoRecordset::AddNew to create new records

If you prefer, you can open the CDaoTableDef for the table in question, and
use the Open( CDaoTableDef* ... ) overloaded function of CDaoRecordset.



Sat, 22 Jul 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Does CDAORecordset lock records on Edit/AddNew ?

2. CRecordset AddNew() - moving to new record added.

3. MEMORY LEAK using CDaoRecordset Class and AddNew() method

4. Can't create new record using CRecordset derived class

5. CDaoRecordset - adding new records

6. Slow Record Addition using VC++ CRecordSet's AddNew and Update functions

7. Slow Record Addition using CRecordSet's AddNew and Update functions

8. Reading records using MFC CDaoRecordSet (fast method required!)

9. Problem finding first record using CDaoRecordset class

10. Problem finding first record using CDaoRecordset

11. Reading records using MFC CDaoRecordSet (fast method required!)

12. How do I use AddNew with CDaoRecordset

 

 
Powered by phpBB® Forum Software