Thanks. That was in fact the problem. For some reason when I searched on the
field the first several times, it didn't find the record. Then late last
night, in a fit of desperation, I tried to find the record and lo and behold.
It was there. Deleted it and all was good.
Thanks for responding back.
Andy
-----Original Message-----
From: Cameron Childress [mailto:[EMAIL PROTECTED]
Sent: Saturday, February 07, 2004 5:18 PM
To: CF-Talk
Subject: RE: MS Access Error Message Problem
This error pretty much only happens when you are accidentally inserting a
value which has already been inserted. Take a look at the debug output from
the query and make sure the data you are inserting isn't already in the DB.
You might find that the info in the debug isn't what you thought it was.
Also, check the debug output for duplicate inserts. You could be
accidentally looping over something you think you aren't or accidentally
calling something twice that you think you aren't.
-Cameron
-----------------
Cameron Childress
Sumo Consulting Inc
---
land: 858.509.3098
cell: 678.637.5072
aim: cameroncf
email: [EMAIL PROTECTED]
-----Original Message-----
From: Andy Ousterhout [mailto:[EMAIL PROTECTED]
Sent: Saturday, February 07, 2004 11:37 AM
To: CF-Talk
Subject: MS Access Error Message Problem
I am getting the following message on an Insert query to an MS database:
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
I have two fields that must be unique and the values being inserted do not
yet
exist in the database. I've checked all of the indexes and only one
relationship exists to this database and that is a 1 to 0-Many.
I've also reindexed the database.
What else could be going on????
Here is the insert statement:
<cfquery name="qryOrder" datasource="#instance.Settings.DSN#" dbtype="ODBC"
UserName="#instance.Settings.DBWrite.ID#"
password="#instance.Settings.DBWrite.PW#">
Insert into tabOrders
(OrderNumber, Customers_FK, PeachtreeOrderNumber, OrderDate,
IsOrderClosed,
ShipToAddressKey, ShipToName, ShipToAddr1, ShipToAddr2,
ShipToCity, ShipToState,ShipToZip, ShipToCountry,
PO, RequestedShipDate, ShippingMethod, Terms, SalesTax,
ShippingChrg, Comment, EnteredBy_FK, ChangedOn)
Values (
<cfqueryparam value="#instance.OrderNumber#"
cfsqltype="cf_sql_numeric">,
<cfqueryparam value="#instance.CustomerKey#"
cfsqltype="cf_sql_numeric">,
<cfqueryparam value="#instance.PeachtreeOrderNumber#"
cfsqltype="cf_sql_char">,
<cfqueryparam value="#instance.OrderDate#"
cfsqltype="CF_SQL_DATE">,
<cfqueryparam value="#instance.IsOrderToBeClosed#"
cfsqltype="CF_SQL_BIT">,
<cfqueryparam value="#instance.ShipToAddressKey#"
cfsqltype="cf_sql_numeric">,
<cfqueryparam value="#instance.ShipTo.Name#"
cfsqltype="cf_sql_char">,
<cfqueryparam value="#instance.ShipTo.Addr1#"
cfsqltype="cf_sql_char">,
<cfqueryparam value="#instance.ShipTo.Addr2#"
cfsqltype="cf_sql_char">,
<cfqueryparam value="#instance.ShipTo.City#"
cfsqltype="cf_sql_char">,
<cfqueryparam value="#instance.ShipTo.State#"
cfsqltype="cf_sql_char">,
<cfqueryparam value="#instance.ShipTo.PostalCode#"
cfsqltype="cf_sql_char">,
<cfqueryparam value="#instance.ShipTo.Country#"
cfsqltype="cf_sql_char">,
<cfqueryparam value="#instance.PONumber#"
cfsqltype="cf_sql_char">,
<cfqueryparam value="#instance.RequestedShipDate#"
cfsqltype="CF_SQL_DATE">,
<cfqueryparam value="#instance.ShippingMethod#"
cfsqltype="cf_sql_char">,
<cfqueryparam value="#instance.Terms#"
cfsqltype="cf_sql_char">,
<cfqueryparam value="#instance.SalesTax#"
cfsqltype="CF_SQL_MONEY">,
<cfqueryparam value="#instance.ShippingCharge#"
cfsqltype="CF_SQL_MONEY">,
<cfqueryparam value="#instance.OrderComment#"
cfsqltype="CF_SQL_VARCHAR">,
<cfqueryparam value="#instance.UserKey#"
cfsqltype="cf_sql_numeric">,
<cfqueryparam value="#arguments.DateChanged#"
cfsqltype="CF_SQL_TIMESTAMP">);
</cfquery>
Any and all thoughts are much appreciated.
Andy
Andy Ousterhout
O'My Goodness
www.omygoodness.com
910 Sherwood Drive, Unit 19
Lake Bluff, IL 60044
Phone 847.735.9890
Fax 847.735.9910
Yahoo IM: andy_ousterhout
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

