Key Violation, No Primary Key

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

My append query will not append ALL of my records, due to key violations. I
had a multi-field primary, but during experimenting, I took it off. I STILL
get key violations for all 10,526 records, and all of my indexed fields allow
duplicates. What else could it be?

Thanks!
 
Okay,
a BIG DUH!!

I had emptied my customers table, which has a primary key for the table I
was trying to update. I emptied it during testing and Didn't remember! Boy
am I a dummy.

BUT , I have one more question.

When I do an append query to add new records that do not match ones in the
current table, like this:

INSERT INTO tFit ( style_pk )
SELECT DISTINCT N.style
FROM tFit AS F RIGHT JOIN tFresh AS N ON F.style_pk=N.style
WHERE (((F.style_pk) Is Null));

It never fails that the query will tell me it can't append 1 record, and
when I go in to view the append query, it is always a completely null record,
of which I KNOW there are no real null records in the tables I am appending
from. It happens every time.

Why is that caused? How can I stop it?

THANK YOU!
 
:
When I do an append query to add new records that do not match ones in the
current table, like this:

INSERT INTO tFit ( style_pk )
SELECT DISTINCT N.style
FROM tFit AS F RIGHT JOIN tFresh AS N ON F.style_pk=N.style
WHERE (((F.style_pk) Is Null));

It never fails that the query will tell me it can't append 1 record, and
when I go in to view the append query, it is always a completely null
record,
of which I KNOW there are no real null records in the tables I am
appending
from. It happens every time.
I don't know, but could you verify that
following query returns no records?

SELECT * FROM tFresh As N
WHERE Len(Trim(N.Style & "")) = 0;

this would catch null plus those that
"look like" null, i.e., zero-length strings
and just SPACE(s).
 
sounds like you have "Output all fields"
checked in

Tools/Options/Tables/Queries

I could be mistaken....
 
Sound to me that they are both "New Record" rows.

The only difference is that if the Focus is on this row, it becomes an
"edit" row with the right-pointing arrowhead on the on the RecordSelector.
For a "New Record" row without the focus, the asterisk is shown on the
Record Selector.
 
Back
Top