//  home   //  advanced search   //  news   //  categories   //  sql build chart   //  downloads   //  statistics
 ASP FAQ 
Home
ASP FAQ Tutorials

   8000XXXX Errors
   ASP.NET 2.0
   Classic ASP 1.0
   Databases
   General Concepts
   Search Engine Optimization (SEO)

Contact Us
Site Map

Search

Web
aspfaq.com
tutorials.aspfaq.com

ASP FAQ Tutorials :: 8000XXXX Errors :: Why do I get 80040E2F errors?


Why do I get 80040E2F errors?

Microsoft OLE DB Provider for ODBC Drivers error '80040e2f' 
[Microsoft][ODBC Microsoft Access Driver]Error in row
 
This can happen if you are attempting to delete records while looping through an ADODB.Recordset object. Use regular DELETE statements instead of ADODB.Recordset's DELETE method: 
 
<% 
    ' ... 
    conn.execute("DELETE table WHERE column ...") 
%>
 
This will be more efficient code, and will alleviate the 'error in row' problem. 
 
Microsoft OLE DB Provider for ODBC Drivers error '80040e2f' 
[Microsoft][ODBC SQL Server Driver][SQL Server]Violation of PRIMARY KEY 
constraint 'PK_<tablename>'. Cannot insert duplicate key in 
object '<tablename>'. 
 
or 
 
Microsoft OLE DB Provider for ODBC Drivers error '80040e2f' 
[Microsoft][ODBC Microsoft Access Driver] 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.
 
This is pretty straight forward; you're attempting to insert/update a row with a value that already exists, on a column (or set of columns) that is defined as a primary key. By definition, a primary key can only have one 'copy' of each unique value. Either investigate the coding logic that is generating these primary keys for insert/update, or re-examine whether this column should, in fact, be a primary key. If the column(s) should be a primary key, consider validating prior to insert... if someone is trying to insert a new row that already exists (at least in terms of the primary key), stop them BEFORE the error is tripped up. 
 
Microsoft OLE DB Provider for ODBC Drivers error '80040e2f' 
[Microsoft][ODBC Microsoft Access Driver] You cannot add or change a record 
because a related record is required in table '<tablename>'.
 
Sounds like you have a foreign key defined, and are not satisfying its requirements. E.g. if you have table Parent, with an Autonumber column, and table Child, with a foreign key that references table Parent's Autonumber column, you should check that you are inserting into table Parent first, and that any updates to table Child are still referencing a valid column in table Parent. (This should be done in the reverse order when deleting records... you should delete from table Child first, then the 'master' record from table Parent.)

Related Articles

Why do I get 8002000A errors?
Why do I get 80040200 / 80040514 / 800A0E7A errors?
Why do I get 80040e09 errors?
Why do I get 80040E0C errors?
Why do I get 80040E10 errors?
Why do I get 80040E14 errors?
Why do I get 80040E21 errors?
Why do I get 80040E23 errors?
Why do I get 80040E24 errors?
Why do I get 80040e30 errors?
Why do I get 80040E31 errors?
Why do I get 80040E37 errors?
Why do I get 80040e4e errors?
Why do I get 80040E54 errors?
Why do I get 80040E57 / 80040E07 errors?
Why do I get 8004D00A errors?
Why do I get 80070070 errors?
Why do I get 800A01FB errors?
Why do I get 800A0BB9 / 800A1391 errors?
Why do I get 800A0C93 errors?
Why do I get 800a0cb3 errors?
Why do I get 800A0CC1 errors?
Why do I get 800A0E78 errors?
Why do I get 800A0E7C errors?
Why do I get 800A0E7D errors?
80004005 Errors
Can I use the NZ() function without getting 80040E14 errors?

 

 


Created: 8/18/2002 | Last Updated: 8/18/2002 | broken links | helpful | not helpful | statistics
© Copyright 2006, UBR, Inc. All Rights Reserved. (151)

 

Copyright 1999-2006, All rights reserved.
Finding content
Finding content.  An error has occured...