Problems inserting to access db

Results 1 to 2 of 2

Thread: Problems inserting to access db

  1. #1
    Ciara Heavin Guest

    Default Problems inserting to access db

    Microsoft JET Database Engine error &#039;80004005&#039; <BR><BR>The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again. <BR><BR>/bsci97/Empinsert.asp, line 52 <BR><BR>I have broken all the relationships in my db, I have taken out the primary key, I am not entering in values that are already existing in records and I still have this problem with 4 similar insert statements.<BR>Here it is:<BR><BR>Dim insert<BR>insert="Insert into [Personal Information] (SN, FirstName,LastName,Address1,Address2,Town,County,L ocation,Rural,TelephoneNumber,DateofBirth,MaritalS tatus) Values (&#039;" & StaffNo & "&#039;, &#039;" & FName & "&#039;,&#039;" & Lname & "&#039;,&#039;" & Add1 & "&#039;,&#039;" & Add2 & "&#039;,&#039;" & Tn & "&#039;,&#039;" & Cnty & "&#039;,&#039;" & Loc & "&#039;,&#039;" & Rur & "&#039;,&#039;" & Tnumber & "&#039;,&#039;" & DofB & "&#039;,&#039;" & Mstatus & "&#039;)"<BR>Call objConn.Execute (insert)<BR>If someone could shed a bit of light I would be really grateful.<BR>Ciara<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Problems inserting to access db

    Have you tried going into the design mode of your DB and double-checking the values. Most likeley you have a flag set in one of your primary keys that wont let you create a duplicate value (im guessing). I would go back through the DB and check this.

Posting Permissions

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