🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.multi-tier
Article #1228

OnUpdateError() problem

#1228
From: Juan Diego Garcés
Date: Tue, 11 Apr 2000 00:00
30 lines
1866 bytes
Hi,

I am using a TClientDataSet exclusively to insert records (whose data
are read from a text file) in an Interbase DB using a TProvider (It is
not a multitiered application, all the components are used in the same
exe to increase the speed of insertion...).

When using the ApplyUpdates() method of the TClientDataSet, I would like
to catch errors that
come from a possible foreign key violation, and let the user change some
values of this record to enable its insertion in the database.

Using the OnUpdateError() event of the provider with TResolverResponse
set to rrApply and modifying the field 's NewValue accordingly to avoid
the foreign key violation result in the error message :
"Invalid response..."

With SQLMonitor, I found that C++ was trying to find in the Database the
record that  it could not insert, as C++ wanted to update this field.
BUT it was an INSERTION operation which failed, not an update one.

I found an other solution with the OnReconcileError() event of the
dataset but it is less satisfactory since the user must correct ALL the
records which caused trouble without being sure that his modifications
will be accepted by the Database before calling again the ApplyUpdates()
method ...

Is anyone can help me to use the OnUpdateError() event ???

Thanks,
Technical Details
Message-ID: <38F3029B.665CFD45@bluemail.ch>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fcd2b,f7a5fc091233dd8a,start
X-Google-Attributes: gidfcd2b,public
From: Juan Diego Garcés <daes_ch.jdg@bluemail.ch>
Subject: OnUpdateError() problem
Date: 2000/04/11
Message-ID: <38F3029B.665CFD45@bluemail.ch>
X-Deja-AN: 609590722
Content-Transfer-Encoding: 7bit
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
X-Trace: 11 Apr 2000 03:37:09 -0800, 194.209.126.82
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.database.multi-tier