Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2003
    Location
    San Francisco
    Posts
    5

    Question Unanswered: Delete query problem

    a simple delete query:

    DELETE EP3_ShotType_Prcnt.*
    FROM EP3Seq_Deleted INNER JOIN EP3_ShotType_Prcnt ON EP3Seq_Deleted.ID = EP3_ShotType_Prcnt.ID;

    gives out this error: "Cannot delete from specified tables". Help explains this as to the tables having read only attributes. However, various append queries work fine with my EP3_ShotType_Prcnt table, and I can delete records manually.

    This query updates the table from which I am trying to delete, and it works just fine:

    UPDATE EP3_ShotType_Prcnt

    RIGHT JOIN EP3Seq_EP2_AsscUpdate ON EP3_ShotType_Prcnt.EP3Seq_Name = EP3Seq_EP2_AsscUpdate.EP3Seq_Name

    SET EP3_ShotType_Prcnt.Sequence = [EP3Seq_EP2_AsscUpdate]![Sequence]

    WHERE (((IIf([EP3Seq_EP2_AsscUpdate]![Sequence]=[EP3_ShotType_Prcnt]![Sequence],"No update","Update"))="update"));


    Another symptome is that when running this DELETE query as SELECT it gives the correct row that should be deleted.

    has any one encountered anything like this before, and are there any solutions?

    Thanks,

    max
    Last edited by Yartsev; 08-04-03 at 18:58.

  2. #2
    Join Date
    Aug 2003
    Location
    Bosnia & Hercegovina
    Posts
    57
    the problem is the relationship you created in your query, and by deleting records you violate the relationship rules.....

    what I do in situation when I need related tables to determine what to delete, I use two queries....

    first query is update query that marks what records are to be deleted, you can use a text field and fill it with 'DEL' or other unusual (impossible) value for the field....

    second query is a delete on table that you want to delete from with a criteria set to that special word/number....

    I've come accross this problem too many times, now I know what to do.......

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •