Adding Records to empty table? 
Author Message
 Adding Records to empty table?

Working with VB 5.0 and an MS-Access MDB file, i want to write code which
adds records when a user clicks on a button.  This works fine with tables
that have records already in them, but if the table is empty, any attempt
to add a record returns the runtime error of "This action was cancelled by
an associated object."  I've tried several methods for adding a record, all
of which fail.

Two questions:

Is it failing because the current record value is set to -1 and it tries to
bookmark it?

How can i get it to add a record to an empty table?  For development
purposes I can add records using the data manager, but when this project
ships to my client, it will do so with an empty mdb file that they will
begin to fill.

Please reply via email as well as to the ng so that I can receive responses
immediately.  Thanks!
--

Adrian Goins

http://www.*-*-*.com/



Fri, 10 Mar 2000 03:00:00 GMT  
 Adding Records to empty table?

Are you sure that your "empty" table is populated with fields ie does the
Tabledef have an associated Field Collection?
--
Pete B



Quote:
> Working with VB 5.0 and an MS-Access MDB file, i want to write code which
> adds records when a user clicks on a button.  This works fine with tables
> that have records already in them, but if the table is empty, any attempt
> to add a record returns the runtime error of "This action was cancelled
by
> an associated object."  I've tried several methods for adding a record,
all
> of which fail.

> Two questions:

> Is it failing because the current record value is set to -1 and it tries
to
> bookmark it?

> How can i get it to add a record to an empty table?  For development
> purposes I can add records using the data manager, but when this project
> ships to my client, it will do so with an empty mdb file that they will
> begin to fill.

> Please reply via email as well as to the ng so that I can receive
responses
> immediately.  Thanks!
> --

> Adrian Goins

> http://www.arces.net



Fri, 10 Mar 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ADO2.5, can't add new record to an empty table using record binding

2. How to add new record to an empty table

3. Adding Records to an Empty Table

4. add record to an empty table using RDO 2.0 and Visual basic 6.0

5. Empty resultset when adding to empty table : error

6. need something like foreach record in table - add record to another table

7. Cannot add record to Visual Foxpro table after deleting all records in table

8. Checking if a record is duplicated before adding or during adding it to a table

9. deleting records in a table and then adding new records

10. RDC, empty resultset, adding record ?

11. HELP: Can't add new records to an empty dynaset

12. Adding a record to an empty recordset

 

 
Powered by phpBB® Forum Software