Insert into Parent and Child in Access Relational DB

Insert into Parent and Child in Access Relational DB

am 12.04.2007 16:18:59 von PinkBishop

Can somebody direct me on proper syntax of SQL statement to insert
into one table that has child table in a relational database?

I can get the insert to work for the Parent, but a record also needs
to be inserted into the Child. Below is an example of my tables. I
get Table 1 to insert no problem. What I need is table 2 to populate
based on the catID from table 1 which is primarty key and selected
imgID from table 3. Thanks for your help.

EX.

Table 1
catID
imgID
venID


Table 2
catID
imgID


Table 3
imgID
imgName

Re: Insert into Parent and Child in Access Relational DB

am 12.04.2007 16:51:28 von reb01501

PinkBishop wrote:
> Can somebody direct me on proper syntax of SQL statement to insert
> into one table that has child table in a relational database?
>
Please do not multipost PinkBishop. This is definitely a
database-related question
so .asp.db was the perfect group in which to post it. Posting it here as
well did not increase your chances of getting an answer (most of us
subscribe to both groups). On the contrary, if somebody had taken his
time
to answer it here, only to find that it was already resolved in the
other
group, that person may have been annoyed enough to ignore any future
posts
from you, thereby decreasing your chances of getting help in the future.

There are times when you will not be sure which group is most
appropriate,
and you will want to post a question to both groups. In that situation,
you
should use the cross-posting technique, rather than posting the same
message
multiple times. To crosspost, put a semicolon-delimited* list of the
newsgroups to which you wish to post in the To: header of your post and
post
it once. It, and any replies to it, will appear in all the newsgroups in
your list. So, if I reply in .asp.db, my reply will also appear here in
..asp.general.

* ... or whatever delimiter is recognized by your news client
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Re: Insert into Parent and Child in Access Relational DB

am 12.04.2007 17:01:46 von PinkBishop

Sorry, I am usually pretty good at finding the appropriate group and
such. I need to look into your crosspost solution.

Thanks

On Thu, 12 Apr 2007 10:51:28 -0400, "Bob Barrows [MVP]"
wrote:

>PinkBishop wrote:
>> Can somebody direct me on proper syntax of SQL statement to insert
>> into one table that has child table in a relational database?
>>
>Please do not multipost PinkBishop. This is definitely a
>database-related question
>so .asp.db was the perfect group in which to post it. Posting it here as
>well did not increase your chances of getting an answer (most of us
>subscribe to both groups). On the contrary, if somebody had taken his
>time
>to answer it here, only to find that it was already resolved in the
>other
>group, that person may have been annoyed enough to ignore any future
>posts
>from you, thereby decreasing your chances of getting help in the future.
>
>There are times when you will not be sure which group is most
>appropriate,
>and you will want to post a question to both groups. In that situation,
>you
>should use the cross-posting technique, rather than posting the same
>message
>multiple times. To crosspost, put a semicolon-delimited* list of the
>newsgroups to which you wish to post in the To: header of your post and
>post
>it once. It, and any replies to it, will appear in all the newsgroups in
>your list. So, if I reply in .asp.db, my reply will also appear here in
>.asp.general.
>
>* ... or whatever delimiter is recognized by your news client