Hi,
 
In D6, I use a TClientDataSet because it allows editing data from a complex,
evidently read-only, query and also because there are detail tables included
in TDataSetFields. This allows a convenient way to allow the user to edit
and use the ApplyUpdates mechanism to get the data where it belongs. Now
this particular Cds is the only one in the app; all other datasets are query
components.
 
Although I use ApplyUpdates, I don't want to bother the user with first
editing the CDS and later apply the updates. After each edited or inserted
record is posted in the CDS, or after each record deletion, I was
ApplyUpdates to happen implicitly.
 
The problem here is error handling. Suppose, a user adds a new record in a
query component. Then the following happens:
 

1.      Enter dsInsert mode
2.      Enter the data
3.      Post it
4.      On the exception, the dataset remains in insert mode, the user gets
the error message and after closing the error dialog, he can proceed in
insert mode.

 
However, in the CDS, the following happens:

1.      Enter dsInsert mode
2.      Enter the data
3.      Post it -> now the dataset is in dsBrowse mode
4.      ApplyUpdates
5.      On exception, the dataset is in dsBrowse mode and it can never
return to dsInsert mode for the same record, unless I save the data just
before posting, delete the inserted record, go to dsInsert mode again and
reinsert the record...

Is there a good way to make the CDS completely transparent to the user.
Somehow I suspect Borland, they neglected the fact the CDS would also be
used in non-briefcase situations.
__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk

Reply via email to