Solved

ApplyUpdates

Posted on 1998-08-13
2
308 Views
Last Modified: 2010-04-04
How to check the cached records to prevent a key violation error when ApplyUpdates is called? Cause the cached records may have duplicated primary keys that do not exists in table.
0
Comment
Question by:oberdan
2 Comments
 
LVL 1

Expert Comment

by:pjdb
ID: 1362007
check everything in the BeforePost event. This way it will check any record before posting (and tehrefore before puting it to the CacheUpdates)

JDB
0
 

Accepted Solution

by:
keksperte earned 100 total points
ID: 1362008
when your program knows the new key, make a verify read with it in on a second chanel ( open the table with a second dbtable component i.g. name it 'temp' so that your origin tablecomponent become not be reflected). With this testread you will be able to catch all conflicts on the fly. Also you have not to enter the whole record and this method prevents you on prewrites.

hope this fix your problem
;-)
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi XE2 application frozen on Windows 10 10 310
Delphi 2 59
Firemonkey webbrowser scrollbars ? 1 38
Graphics32 under Delphi 10.1 Berlin 2 63
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question