🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.multi-tier
1 messages
1 total messages Started by Juan Diego Garcés Tue, 11 Apr 2000 00:00
OnUpdateError() problem
#1228
Author: 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,
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads