Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v5.2
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Cobol v2.1
  HXTT DBF v5.2
  HXTT Excel v4.2
  HXTT Paradox v5.2
  HXTT Text(CSV) v5.2
  HXTT XML v1.2
Offshore Outsourcing
Oracle Data Import/Export
DB2 Data Import/Export
Sybase Data Import/Export
Free Resources
  Firewall Tunneling
  Search Indexing Robot
  Conditional Compilation
  Password Recovery for MS Access
  Password Recovery for Corel Paradox
  Checksum Tool for MD5
  Character Set Converter
  Pyramid - Poker of ZYH
   
   
   
Hongxin Technology & Trade Ltd. of Xiangtan City (abbr, HXTT)

HXTT ACCESS
DELETE: foreign key constraint violated
Patrick
2013-12-12 02:29:41.0
Hello,
I have two tables with a many-to-one relationship. In MS Access, this relation has "check data integrity" enabled, that means if I try to delete a record that has a relationship to existing records in the other table, it will raise an error.

With HXTT driver, the same delete on the same record is possible, with no error whatsoever, resulting in a DB that is not valid anymore.

What did I miss?
Re:DELETE: foreign key constraint violated
HXTT Support
2013-12-12 02:44:12.0
>With HXTT driver, the same delete on the same record is possible,
> with no error whatsoever, resulting in a DB that is not valid anymore.
HXTT Access supports cascading updates and cascading delete. If you meet issue, please email us your sample.

Re:Re:DELETE: foreign key constraint violated
Patrick
2013-12-12 02:48:59.0
It's not a matter of cascading. It should not be possible to delete a row that has this relationship with "check references integrity = true".
MS Access client does not allow it.
Re:Re:Re:DELETE: foreign key constraint violated
HXTT Support
2013-12-12 02:56:13.0
>"check references integrity = true".
HXTT Access checks also references integrity too. In my memory, for many-to-one relationship, you can delete a row of many relation side, but can't delete a row of one relation side before there's any data row of many relation side.
Re:Re:Re:Re:DELETE: foreign key constraint violated
Patrick
2013-12-12 04:49:14.0
You're right, but the problem appears when deleting on the "one"-side of the relationship, and when there are still records on the "many" side.
Re:Re:Re:Re:Re:DELETE: foreign key constraint violated
HXTT Support
2013-12-12 05:39:15.0
Tested. It will throw
Failed to delete record from table ef because primary key referential integrity.
if you delete on the "one"-side of the relationship
Re:Re:Re:Re:Re:Re:DELETE: foreign key constraint violated
Patrick
2013-12-12 07:13:55.0
Ok we found out where the problem is.
In MSACCESS there are three different settings for a relationship definition:

1. "check reference integrity" -> is used to make sure that a record cannot be deleted when referenced in another table, and is on the "one"-side of a one-to-* relationship.

2. "cascade fields changes" -> will change in all records that reference this one

3. "cascade deletes" -> will delete all records that reference this one.


Prolem occurs when only the first setting is set. A DELETE will be accepted without error by HXTT Driver, but not by MS Access.

HXTT Driver should be modified.

P.S. My Mother always told me that relationships are sometimes difficult...
Re:Re:Re:Re:Re:Re:Re:DELETE: foreign key constraint violated
HXTT Support
2013-12-12 07:16:35.0
>Prolem occurs when only the first setting is set. A DELETE will be accepted without error by HXTT Driver, but not by MS Access.
In my test, it will throw Failed to delete record from table ef because primary key referential integrity.
if you delete on the "one"-side of the relationship

So please email us your sample.
Re:Re:Re:Re:Re:Re:Re:Re:DELETE: foreign key constraint violated
Patrick
2013-12-12 07:17:56.0
Sorry the problem occurs when the first TWO settings are set.
We want to check integrity and cascade changes (such as Primary Key modification), but not deletes.
Re:Re:Re:Re:Re:Re:Re:Re:DELETE: foreign key constraint violated
HXTT Support
2013-12-13 00:35:42.0
Supported now. Please download it.
Re:Re:Re:Re:Re:Re:Re:Re:DELETE: foreign key constraint violated
Patrick
2013-12-13 00:50:11.0
Great, it works.
Thanks for your support.

Search Key   Search by Last 50 Questions




Google
 

Address: 9 Station Rd., Xiangtan City, Hunan Province, P.R. China
Postcode: 411100
Phone: (86)731-58225727
Fax: (86)731-58225727
Email: webmaster@hxtt.com
Copyright © 1999-2011 Hongxin Technology & Trade Ltd. | All Rights Reserved. | Privacy | Legal | Sitemap