In your relationship definition, enforce referential integrity and check the
Cascade Update (and Cascade Delete if you will be deleting records) setting.
I think that should take care of it.

Technically, you may also turn off the "enforce referential integrity", but
I would not recommend it.

The problem you experience is that there is no simple way to update the
tables and maintain the referential integrity:

If you modify the "child" first - it won't have a "parent" yet.
If you modify the "parent" first, you will orphan the "child".

If all else fails, you can probably work around this by:

1:  Copy the original parent record, but assign it the new primary key
value.
2:  Modify the child to reference the new parent.
3:  Delete the old parent.

Updating a primary key is NOT a good practice.  This is one of the main
reasons many database designers choose not to use the "natural" keys as the
primary key, but rather establish a "meaningless" primary key, such as an
Identity/AutoNumber column.

HTH,
Tore.

-----Original Message-----
From: Kelly Zhu [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 28, 2002 1:22 PM
To: ActiveServerPages
Subject: update value for a primary key field


I have a db in Access.  I cannot use ASP page to change the value of a field
assigned with primary key and has a one-to-many relationship with a field in
another table.  But I have no problem doing the same thing in Access.  The
ASP page doesn't  give me error, but just doesn't do the job.

Please help.  Thanks.

Kelly


---
You are currently subscribed to activeserverpages as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
%%email.unsub%%

---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to