473,320 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Strange append query problem: Key violation error

I have done append queries before, though not recently, so I may be
doing some very simple error to which I am oblivious. I am using the
query window.

When the query I wanted to do ran into Key Violation errors, I
simplified it to this:

INSERT INTO tblProjects ( ProjectName )
SELECT [0506import].ProjectName
FROM 0506import;

I still got Key Violation errors. I did have tblProjects open but now
it is closed. TblProjects.ProjectName is text, 20 char, Entry Not
required,
Allow Zero length strings, No index. The Import table Project Name
field has exactly the same properties.

What else can I check?

Thank you.

Aug 21 '07 #1
2 1679
Hi Nemo,

Look in the Table Relationships window. Check if there is a
relationship between tblProjects and some other table. If there is --
this is referential integrity. It means that the other table in the
relationship must first contain the value that you are trying to insert.
If that other table does not contain the value then you would not be
able to insert the value into tblProjects. So you need to enter the
value into the other table first. Referential Integrity is what RDBMS
(Access/Sql Server/Oracle...) is all about. This is how you control
duplicate data/redundant data/invalid data from entering your system.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Aug 21 '07 #2
Ben
On Aug 21, 9:03 am, Nemo <nad...@mail.sdsu.eduwrote:
I have done append queries before, though not recently, so I may be
doing some very simple error to which I am oblivious. I am using the
query window.

When the query I wanted to do ran into Key Violation errors, I
simplified it to this:

INSERT INTO tblProjects ( ProjectName )
SELECT [0506import].ProjectName
FROM 0506import;

I still got Key Violation errors. I did have tblProjects open but now
it is closed. TblProjects.ProjectName is text, 20 char, Entry Not
required,
Allow Zero length strings, No index. The Import table Project Name
field has exactly the same properties.

What else can I check?

Thank you.
What is the key field for tblProjects?

Aug 22 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Kristina | last post by:
I'm trying to run multiple append queries in an Access front end that append data from tables in a .mdb into tables in SQL Server 2000. My Access front end has a link to both tables, the .mdb and...
1
by: strauss.sean | last post by:
To all: Hi! I am trying to use an append queries on a table where the key field is numeric, formatted as 00-00-000. The query collects the information corectly, and there are no records...
6
by: dd_bdlm | last post by:
Hi all I have a database that stores customer records and their associated insurance details. I need to be able to archive any changes made to that record. Currently the user selects 'record...
1
by: Kurt | last post by:
For some reason I cannot use an append query to append records to a design master replication table that has the index key on a random Long Integer. I checked all the text fields in the Master...
7
by: pltmcs | last post by:
I am trying to generate some records from one table into another. The problem is that the new table has an autonumber field (PID). The PID is part of the primary key since it is possible to have...
5
by: Jeff | last post by:
Okay, I'm still new to vb.net 2005 - throught this was a hardware problem, but now I don't know. (I'm having some problem with my newgroup provider, so hopefully this will go through) This...
0
by: Filio | last post by:
Hi all: My problem is a little different than the earlier append table post. I have T1 with an autonum field as the primary key, and T2 with identical fields as the first, but no autonum. ...
1
by: MLH | last post by:
Anyone remember if A97 append query failure would ever report data breaking validation rule when such was not the case. I have an old SQL statement - several years old now. I've encountered a case...
10
by: MeeMee | last post by:
Hi I have a problem appending data into an oracle table from access. I imported the new data from an excel sheet into a table in access and useed an append query to add the data into a linked...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.