PDA

Click to See Complete Forum and Search --> : Problemds adding new records to a 3-table query


Diego Fernandez
Aug 24th, 1999, 02:14 PM
Hi there!

I retrieve data from a database using a SQL query of three tables and show this data in a grid. Now we want to add new records to that grid and to the database then.
At the moment we are not using any code for that, trying to do it with a DAO or ADO control but we are not able.
The funny thing is that we can edit the actual data we retrieve from the database, but not add new records, and the oder funny thing (even better I think) is that we can do rhat using Acces.
If we create a query in Access (the same one) and we create a grid from there we can add new records to that query. Unbelivable!

Thanks to all, have fun!

Diego

JHausmann
Aug 24th, 1999, 08:00 PM
In one of my programs, the only thing I use my data control for is to populate fields on the form. I use DAO to add data into my tables.

Roughed out, I do

1) get data
2) make changes to data
3) if existing data, then issue SQL update statement(s)
4) if new data, then issue SQL insert statement(s)
5) refresh data control
6) go to 1 until user is done.

Diego Fernandez
Aug 25th, 1999, 01:50 PM
Thanks a lot I'll try that!

Have fun!

Diego