Results 1 to 7 of 7

Thread: Problem while inserting data in MS Access

  1. #1
    Join Date
    Apr 2010
    Posts
    72

    Problem while inserting data in MS Access

    I just have a message which hurts me to the execution of an application addition:
    INSERT INTO EBP (CODE WORDING, HT)
    SELECT CODE WORDING, HT
    FROM SAB
    WHERE BRS.HT> 0;
    And here is the message:
    Microsoft Access has assigned the null value to 0 field (s) following a conversion error type 1996 record (s) were not added to the table following key violations, 0 record ( s) as a result of violation of lock and 0 record (s) as a result of violations of validation rules. When I run my application even when it works, but this message is not clean, then I had thought about putting something like:
    INSERT INTO EBP (CODE WORDING, HT)
    SELECT CODE WORDING, HT
    FROM SAB
    WHERE BRS.HT> 0 AND BRS.CODE <> EBP.CODE;
    But a box opens up and so I can enter to EBP.CODE ????? Thank you for advance for your help.

  2. #2
    Join Date
    Feb 2010
    Posts
    644

    Re: Problem while inserting data in MS Access

    You can try a trick nag, nested queries:
    Code:
    INSERT INTO EBP (CODE WORDING, HT)
     SELECT CODE WORDING, HT
     FROM SAB
     WHERE BRS.HT> 0 AND BRS.CODE NOT IN (SELECT CODE FROM EBP);
    I am sure that this will help you.

  3. #3
    Join Date
    Feb 2010
    Posts
    796

    Re: Problem while inserting data in MS Access

    Microsoft Access has assigned the null value to 0 field (s) following a conversion error type 1996 record (s) were not added to the table following key violations, 0 record ( s) as a result of violation of lock and 0 record (s) as a result of violations of validation rules .....
    Try to see this (no guarantee!)
    INSERT INTO EBP (CODE WORDING, HT)
    SELECT CODE WORDING, HT
    FROM SAB, EBP
    WHERE BRS.HT> 0 AND BRS.CODE <> EBP.CODE;

  4. #4
    Join Date
    Apr 2010
    Posts
    72

    Re: Problem while inserting data in MS Access

    A warning message appears:
    The specified field 'CODE' may designate more than one table listed in the FROM clause of your SQL statement.
    Access does not seem to reflect the table name in "BRS.CODE <> EBP.CODE". Please help me, I am not able to sort out this problem.

  5. #5
    Join Date
    Feb 2010
    Posts
    678

    Re: Problem while inserting data in MS Access

    Hello, I have a concern with one of my insert statement. In fact it gives me an error message like "Microsoft Access has assigned the null value to 0 field (s) following a conversion error type 1 record (s) have been added the table following key violations, 0 record (s) as a result of violations of lock and 0 record (s) as a result of violations of rules validation". In the case made in this quote is my table empty, it inherits from another table service, with access in the same primary key. So in my vba code I first made the addition to the specifications table and the table service, and even reversing the order of insert the same message. Another thing, my table also includes estimates of the other fields that I do not add in my insert query is what it is annoying? because I put the name of the columns that I want to add so normally it should not be annoying for the execution of the application? Need your assistance.

  6. #6
    Join Date
    Feb 2010
    Posts
    530

    Re: Problem while inserting data in MS Access

    If your primary key is not in the table estimates, ACCESS must add the line ... Or is that your table is not empty, or perhaps the primary key of the line you want to add is not in the correct format (date, string, number ...)?

  7. #7
    Join Date
    Aug 2006
    Posts
    287

    Re: Problem while inserting data in MS Access

    I have checked and my table is empty or so it has no risk of duplication. My primary key is of type AutoNumber. But is it annoying part inheritance, since the two tables provide specifications and have the same name primary key relationship with an a1, I noticed that in the properties of the relationship I cannot put Cascade Update is the corresponding fields in the referential integrity.

Similar Threads

  1. Replies: 4
    Last Post: 27-11-2010, 10:42 PM
  2. Problem Inserting Charts in Office 2007
    By Duncan McC in forum MS Office Support
    Replies: 1
    Last Post: 13-02-2010, 10:36 AM
  3. Lots of errors when inserting data into table
    By MADGE25 in forum Software Development
    Replies: 5
    Last Post: 13-11-2009, 05:49 PM
  4. Inserting bulk data using Java
    By Halyn in forum Software Development
    Replies: 4
    Last Post: 09-11-2009, 05:41 PM
  5. C# using DAO (Data Access Objects)
    By Pragnya in forum Software Development
    Replies: 2
    Last Post: 09-06-2009, 01:31 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,023,372.80331 seconds with 17 queries