updating child tables...

  • Thread starter Thread starter Angelina
  • Start date Start date
A

Angelina

Hi,

I have created a Access.adp database (MSDE). I am trying
to create a stored procedure to inssert a row into a
database but i dont know what to do about the Foreign key
value (FK). e.g.

I have 2 tables

Client table
Client ID..........Autonumber
Name...............Char
Address............Char


Booking Table...... Autonumber
Client ID.......... ? (what do i have as a datatype here?
Arrival Date....... Date
Departure Date..... Date

What i want is when i insert a client into the client
table, i want the autonumbver that is generated to be
cascaded into the booking table.
Is this possible?

Or can i create an insert SPROC that will update both
tables at the same time??

How do i get the autonumber generated from the parent
(Primary key holding table) table into the child table
(holding the foreign key)??

can anyone help me or point me to any useful articles?

thx in advance for your help
 
Hi,

I have created a Access.adp database (MSDE). I am trying
to create a stored procedure to inssert a row into a
database but i dont know what to do about the Foreign key
value (FK). e.g.

I have 2 tables

Client table
Client ID..........Autonumber
Name...............Char
Address............Char


Booking Table...... Autonumber
Client ID.......... ? (what do i have as a datatype here?

Long Integer.
Arrival Date....... Date
Departure Date..... Date

What i want is when i insert a client into the client
table, i want the autonumbver that is generated to be
cascaded into the booking table.
Is this possible?

It's possible but it's generally a Very Bad Idea. What data would you
put into the date fields? Ordinarily one would only add data to a
child table *when you have information to put into that record* -
empty placeholder records are more trouble than benefit. A Subform is
a good way to add the booking data (when you have booking data to
add).
 
Hi John,

Can u explain the concept of a subform to me? is this
something i create in my interface tool (VB.net)?
Is there any articles that can walk me through this
process or would anyone be willing to help me out?

Im sorry but i am new to this :o)

thx for your time
 
Hi John,

Can u explain the concept of a subform to me? is this
something i create in my interface tool (VB.net)?
Is there any articles that can walk me through this
process or would anyone be willing to help me out?

Im sorry but i am new to this :o)

Sorry... I think I misled you! You may need to ask this question in a
vb.net support group; I've toyed with .NET but my experience is
primarily in Microsoft Access (where the Subform is a commonly used
tool). I don't know if it even exists in VB.NET forms.
 
Back
Top