Delete Query giving a 3086 error of "read only file"

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am tring to use a delete query to delete a record and all records affiliated to that record in other tables. I am able to identify and show the records in the linked table that I wish to delete, however get the error of "this database is read only". I have checked the database and find it archived. I can delete records in the database, but not in the resulting delete query, (even when I try manually to delete a record in the datasheet veiw
I do not have network problems either. Can you give me any hints to this problem?
Here is the query in SQL
DELETE Animal.AnimalID, Breeding.
FROM (Animal INNER JOIN Farrowing ON Animal.AnimalID = Farrowing.SowID) INNER JOIN Breeding ON Animal.AnimalID = Breeding.DamI
WHERE (((Animal.AnimalID)=2582))

I get the 64 records I wish to delete, but cannot finish the functio
Thanks!!
Dan
 
You must specify the table from which you want to delete in the DELETE
clause. I assume you want to delete from Breeding, not from Animal. If
that is the case, try this:

DELETE DISTINCTROW Breeding.*
FROM (Animal INNER JOIN Farrowing ON Animal.AnimalID = Farrowing.SowID)
INNER JOIN Breeding ON Animal.AnimalID = Breeding.DamID
WHERE (((Animal.AnimalID)=2582));


--
John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
dwilson said:
I am tring to use a delete query to delete a record and all records
affiliated to that record in other tables. I am able to identify and show
the records in the linked table that I wish to delete, however get the error
of "this database is read only". I have checked the database and find it
archived. I can delete records in the database, but not in the resulting
delete query, (even when I try manually to delete a record in the datasheet
veiw.
I do not have network problems either. Can you give me any hints to this problem??
Here is the query in SQL:
DELETE Animal.AnimalID, Breeding.*
FROM (Animal INNER JOIN Farrowing ON Animal.AnimalID = Farrowing.SowID)
INNER JOIN Breeding ON Animal.AnimalID = Breeding.DamID
 
Back
Top