UPDATE of Parent table does not work when child records exist

K

Klic

I run the following query

The data structure is

Parent Table: Client PK=AccountNumber (Required, duplicates not allowed)
Child Table: ContractHeader Compound PK=AccountNumber, ContractNumber

If I add a Client record then I can modify using the following SQL (from ADO
connection.Execute)

UPDATE Client SET AccountNumber = 1, ClientName = 'TestName', Address1 =
'a1', Address2 = 'a2', Address3 = 'a3', ContactNumber = '734253' WHERE
AccountNumber = 1

But when the Client has an associated ContractHeader the query gives the
following message

"The record cannot be deleted or changed because table 'ContractHeader'
includes related records."

from SQL view using the same query I get the following error

"Microsoft Access can't update all the records in the update query.
<snip>... 1 record(s) due to key violations...<snip>"

Help / ideas would be appreciated
regards,

Keith

Access 2000.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top