.. didn't add 1 records(s) to the table due to key violations

eight_88

New member
Local time
Today, 16:39
Joined
Mar 26, 2012
Messages
1
Hi,

I'm trying to insert a record into this table

<table Network>
NetworkID - Text
Name - Text
Nsort1 - Text
Nsort2 - Text
Nsort3 - Text
Comments - Text
_NUNIQUEID - Text
</table Network>


using this statement..
<sql>
"INSERT INTO [Network] (NetworkID, Name) VALUES ('SampleID', 'SampleName');"
</sql>


It prompted failed due to key violation message.

I'm guessing it's because of the _NUNIQUEID column, so
1. I've tried inserting a unique random value to _NUNIQUEID but failed.
2. Looked at the table design, there's no default value for all the columns and all are set to not required. NetworkID is limited to 10 char and Name is limited to 61 char

I'm new to Ms Access, and this is a 3rd party .mdb file. I've read somewhere about this is a behavior of a linked table or something (not sure if this is a linked table, anyway). How can I insert data into this table?
 
(not sure if this is a linked table, anyway).
Move your mouse cursor to hover over the name of the table. If the ControlTip text lists a path in addition to the name of the table, it is linked. What version of Access are you using? In 2010, the a linked table is graphically represented by an arrow on the left of the table pointing to the table (I belive it's the same in 2007, but that version's on my work laptop and I'm too lazy to boot it up right now).

I'm guessing it's because of the _NUNIQUEID column, so
1. I've tried inserting a unique random value to _NUNIQUEID but failed.
2. Looked at the table design, there's no default value for all the columns and all are set to not required. NetworkID is limited to 10 char and Name is limited to 61 char

Check the "Indexed" property of each field in design view. Is any labelled as "Yes (No Duplicates)?"
 

Users who are viewing this thread

Back
Top Bottom