Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question about a key violation error

Status
Not open for further replies.

KerryL

Technical User
May 7, 2001
545
US
When I run an append query I'm receiving an error message stating that it won't append 300 records to the table due to a key violation.

The append query compiles data from tables in 20 separate databases into a master table for reporting. To handle key fields, I dump key field data (autonumbers) into a regular number field in the master table, so I don't understand why I'm getting key violations.

I looked at the tables but can't figure out the problem. And what's wierd is that 1 of the 3 append queries works just fine but the other two give me key violation errors.

Am I missing something obvious? What's the first thing I should look for?
 
No unique index in the receiving table ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 

One of the fields that was a key field for the site data tables is indexed with no duplicates. It's also the "one" side of a one-to-many relationship.

Is that where the problem lies?

How can I maintain that relationship and get the tables to append properly? Change it to indexed but allow dupes (even though there won't be any)?
 
It's also the "one" side of a one-to-many relationship
Be sure to append ALL the parent records BEFORE any of the childs.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Be sure to append ALL the parent records BEFORE any of the childs.

I have the queries running in an order from top to bottom. IOW. tables with parent records go first, then the child tables that contain the "many" records of the relationships.

But I still get the error and I don't understand why.
 
what is the actual error message you are recieving when you try to append?


Leslie

In times of universal deceit, telling the truth will be a revolutionary act. - George Orwell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top