Re: Row can not be located ... on Delete



Kevin is correct. Deleting a joined result set will most likely result in
all the joined records being deleted as well.

The error you are receiving means that one of the values/fields for either
the main table or joined table has changed since the query was executed.
ADO will check underlying values before executing.

If you only need a single record from one table in the join deleted, I would
suggest capturing the primary key of the table executing a SQL delete
statement using that key.

"Delete From SomeTable Where SomeKey = SomeKeyValue"

After you delete it, then you can do a requery to refresh to gui (if
needed).

HTH,
-Steve-

"Eugene V. Goldberg" <egold@xxxxxxxxx> wrote in message
news:4815ab71$1@xxxxxxxxxxxxxxxxxxxxxxxxx
D5, MS SQL 2000.

I have a dataset which joins 3 tables:

SELECT CIV_HEAD.*, CIV_PLAINTIFF.LAST_NAME,
CIV_PLAINTIFF.FIRST_NAME, CIV_PLAINTIFF.MIDDLE_NAME,
CIV_DEFENDANT.BUSINESS_NAME, CIV_DEFENDANT.LAST_NAME,
CIV_DEFENDANT.FIRST_NAME, CIV_DEFENDANT.MIDDLE_NAME
FROM CIV_HEAD LEFT JOIN CIV_PLAINTIFF ON CIV_HEAD.ID = CIV_PLAINTIFF.RID
LEFT JOIN CIV_DEFENDANT ON CIV_HEAD.ID = CIV_DEFENDANT.RID

All 3 tables have AutoInc ID field defined as primary key.

When i am trying to delete a record, it raises exception

Row cannot be located for updating. Some values may have been changed
since it was last read.

What am i missing? I expect Delete to remove the record from CIV_HEAD
table...

Thanx,
Eugene.



.



Relevant Pages