A
Aldred@office
Hi,
I am doing a classic insert to multiple related tables in Access. What I
used to do is to insert one record in the top table, then select the just
inserted record with some data and fetch the ID out. The ID will be used
for inserting to other related tables.
Is the above method the only way in solving the problem? Is there any
newer/better way to do that? Like I could have the ID right away without
doing another Select?
Also, can I do one insert into 3 different related tables? What I used to
do in SQL was that I will use trigger. If anything goes wrong, the DB will
revert to what it used to be. But if I seperate that into 3 inserts, if
something wrong during the process, the data integrity might have problem.
Can someone suggest me some ideas on attacking the issue?
Thanks.
I am doing a classic insert to multiple related tables in Access. What I
used to do is to insert one record in the top table, then select the just
inserted record with some data and fetch the ID out. The ID will be used
for inserting to other related tables.
Is the above method the only way in solving the problem? Is there any
newer/better way to do that? Like I could have the ID right away without
doing another Select?
Also, can I do one insert into 3 different related tables? What I used to
do in SQL was that I will use trigger. If anything goes wrong, the DB will
revert to what it used to be. But if I seperate that into 3 inserts, if
something wrong during the process, the data integrity might have problem.
Can someone suggest me some ideas on attacking the issue?
Thanks.