[ACCESS] Delete Query Table Join

Solved
artamys Posted messages 122 Registration date   Status Member Last intervention   -  
artamys Posted messages 122 Registration date   Status Member Last intervention   -
Hello,
I am making a join query of tables A and B for the common data.
I would like to delete the data from the join query with a delete query, but I get an error message saying that I am not allowed to delete.
There are no issues with post administrator or anything else.

Any idea?
Configuration: Windows Vista Internet Explorer 7.0

5 answers

  1. artamys Posted messages 122 Registration date   Status Member Last intervention   7
     
    no, actually, it's the code that works.

    Query No. 6 joins two tables without integrity.
    And creating a deletion query based on this query brought up an error message saying that we could not delete the data. In the creation of the query, ACCESS was actually attempting to delete from both tables when it should only delete from one table; I think the error message was related to the fact that Access did not know where to delete the data from? Table 1 or 2?

    With the modification of the SQL code as in the code above, there is no longer any issue.

    Thank you very much Blux (for this help and all the others...)
    6
  2. artamys Posted messages 122 Registration date   Status Member Last intervention   7
     
    Hello and thank you for your help, here is another solution that does not require the implementation of integrity.

    SQL code:
    "

    DELETE DISTINCTROW Table2.*, Table2.main_id
    FROM Table2
    WHERE (((Table2.main_id) In (select main_id from Requête6)));

    "
    1
    1. blux Posted messages 2051 Registration date   Status Moderator Last intervention   3 455
       
      So, is this request the problem?

      --

      A+ Blux
       "Fools take risks. That's how you recognize them." 
      0
  3. blux Posted messages 2051 Registration date   Status Moderator Last intervention   3 455
     
    Hi,

    Maybe a referential integrity constraint?

    Detail your queries and your tables (primary keys), so we can see...

    --

    See you Blux           
     "Fools can do anything. That's how you recognize them"
    0
  4. simo_tsdi Posted messages 40 Status Member 2
     
    In your diagram, please check the box for cascading data deletion.
    0
  5. artamys Posted messages 122 Registration date   Status Member Last intervention   7
     
    Thank you both.
    This issue is encountered by a colleague. I will look into the hypothesis of referential integrity, but it is possible that he did not create any at all. I will investigate further. In any case, thank you very much!!!
    0
    1. blux Posted messages 2051 Registration date   Status Moderator Last intervention   3 455
       
      If there are no constraints, then everything can be deleted without issue...

      --

      A+ Blux
       "The idiots dare everything. That's exactly how we recognize them" 
      0