Delete query

  • Thread starter tspies85 via AccessMonster.com
  • Start date
T

tspies85 via AccessMonster.com

Hi,
When i do a delete query, after a message box ( you are about to delete 2
rows from the specific table.../)
then i click yes. after that another message box appear,( system can't delete
2 rows... due to key violation and another 1 record due to lock violation)
why this is happening?
 
T

tina

if you're getting a "key violation" error, i'm guessing that the records
you're trying to delete are in a "parent" table linked to a "child" table,
with referential integrity enforced on the link, but CascadeDelete *not*
enabled. in that case, Access will not allow a parent record to be deleted
if a child record exists. but BEWARE - before you rush in and enable
CascadeDelete, think through your process carefully. CascadeDelete has its'
uses, but should be enabled in a tables relationship ONLY AFTER a very
thorough consideration of the ramifications of *automatically* deleting
child records from your database.

as to the lock violation, i can only guess that you or someone else is
currently editing one of the records that the query is trying to delete.

hth
 

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