Results 1 to 2 of 2
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Append Query Gives Error Message (2000)

    INSERT INTO G1Dez ( GIORNO, LETTUR, ORA_LET, ORE_MARC, POT_MAX, COSFI, TENS_MED, N_PARAL, N_PARAT, MIL_PREC, LETTUR1, CODF, CODI, CODT, <!t>[NOTE]<!/t>, OREF, PORT1, Salto )
    SELECT [LETTURE1].[GIORNO], [LETTURE1].[LETTUR], [LETTURE1].[ORA_LET], [LETTURE1].[ORE_MARC], [LETTURE1].[POT_MAX], [LETTURE1].[COSFI], [LETTURE1].[TENS_MED], [LETTURE1].[N_PARAL], [LETTURE1].[N_PARAT], [LETTURE1].[MIL_PREC], [LETTURE1].[LETTUR1], [LETTURE1].[CODF], [LETTURE1].[CODI], [LETTURE1].[CODT], [LETTURE1].<!t>[NOTE]<!/t>, [LETTURE1].[OREF], [LETTURE1].[PORT1], [LETTURE1].[PORT2] AS Salto
    FROM LETTURE1
    WHERE ((([LETTURE1].[D_CENT])="dezzo") And (([LETTURE1].[N_GRUP])="1"));

    When I run the above append query(Query1) in the attached mdb I get the attached error message.
    What kind of key violations are at play here?
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Append Query Gives Error Message (2000)

    There is a relationship between G1DEZ and Fermi on the CODF field, with referential integrity enforced. There are 65 records selected by the query that have a 0 value in CODF. This value does not occur in Fermi, so referential integrity prevents those records from being added.

    Possible olutions:
    - If you want to allow 0, add a record to FERMI with CODF = 0.
    - If you don't want to allow 0 values, either modify the query to exclude records from LETTURE1 with CODF = 0 (the 65 records will NOT be added), or clear all the zeros in the CODF field in LETTURE1 (Edit | Replace...) before running the query (the 65 records will be added)

Posting Permissions

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