I'm using TSQLDataSet -> TDataSetProvider -> TClientDataSet.
I set Provider.UpdateMode=upWhereKeyOnly.
In the TSQLDataSet I set ProviderFlags=[pfInUpdate,pfInWhere,pfInKey] only
in the first field (the primary key field).
In the ClientDataSet I set ProviderFlags=[pfUpdate,pfWhere] in all fields.
In the ClientDataSet.OnNewRecord I set zero to the key field to initialize
it.
My problem happens when I try to post a second record on the ClientDataSet.
I obtain a "Key Violation" message. I don't have any KeyFields defined in
the ClientDataSet. If the ClientDataSet is working in memory, why it uses
definitions of the SQLDataSet?
I want to set the key field only when I apply the updates to all records,
because before I don't know if the user wants to cancel everything.
Thanks to all,
RFR
On Wed, 26 Mar 2003 01:54:58 -0000, "Rui Filipe Ribeiro"
<ruifilip...@mail.telepac.pt> wrote:
>Hi,
>
>I'm using TSQLDataSet -> TDataSetProvider -> TClientDataSet.
>I set Provider.UpdateMode=upWhereKeyOnly.
>In the TSQLDataSet I set ProviderFlags=[pfInUpdate,pfInWhere,pfInKey] only
>in the first field (the primary key field).
>In the ClientDataSet I set ProviderFlags=[pfUpdate,pfWhere] in all fields.
>In the ClientDataSet.OnNewRecord I set zero to the key field to initialize
>it.
>
>My problem happens when I try to post a second record on the ClientDataSet.
>I obtain a "Key Violation" message. I don't have any KeyFields defined in
If you post two records with the same primary key value you do have a
key violation.<g> The CDS tries to mimic the constraints of the
database you are connected to. The best way to handle this depends on
what database you are using. Since I do not know that the best I can
do is refer you to
http://bdn.borland.com/article/0,1410,20847,00.html.
--
Bill (TeamB)
(TeamB cannot respond to questions received via email)
--
Dave Rowntree
"Rui Filipe Ribeiro" <ruifilip...@mail.telepac.pt> wrote in message
news:3e81...@newsgroups.borland.com...
RFR
"Rui Filipe Ribeiro" <ruifilip...@mail.telepac.pt> escreveu na mensagem
news:3e81...@newsgroups.borland.com...