GARANTIR DESCONTO

Fórum ClientDataSet se registros foram modificados #274798

31/03/2005

0

[b:f8a4ec956e]Olá pessoal![/b:f8a4ec956e]

Gostaria de saber se existe algum método do TClientDataSet que me informe se algum registro foi modificado (não especificamente um registro, para isso eu usaria a propriedade Modified, só que ela diz apenas se o registro atual foi modificado, e não se o conjunto de registros no geral foi modificado de alguma forma)...

Existe alguma solução?

PS: Se não me engano, as modificações ficam armazenadas na propriedade Delta. Se eu criasse em tempo de execução um ClientDataSet e passasse o Delta do ClientDataSet que eu quero conferir para Data deste recém criado, e usasse a propriedade RecordCount para ver se existe algum registro nele, daria certo?

Abraços...


Yuri_fatec

Yuri_fatec

Responder

Posts

31/03/2005

Rômulo Barros

[u:c9972dbd8a]Verifique a propriedade [b:c9972dbd8a]Delta[/b:c9972dbd8a] do TClientDataSet.[/u:c9972dbd8a]

   if ClientDataSet1.Delta >0 then
   Begin
      ShowMessage(´Houve alterações´);
   End;


property Delta: OleVariant; Description Use Delta to pass a packet of change log data from the client dataset to a provider. Delta contains only information about those records inserted, modified, or deleted through the client. When the client dataset is linked to a provider, Delta is passed as an argument to the ApplyUpdates and Reconcile methods, which use the information in the change log to update the database. On return from successful application of updates, Delta is cleared. If update errors occur, the value of Delta after applying updates depends on the error tolerance allowed by the client dataset. This value is All change log data when the maximum number of tolerated errors is encountered and all changes are rolled back. Only those changes that could not be applied when fewer errors occurred than the maximum specified as a tolerance level. In file-based applications, Delta is cleared when the changes are merged into the Data property using the MergeChangeLog method.



_____________________________________________
[b:c9972dbd8a][color=blue:c9972dbd8a]Utilize a Ferramenta de Pesquisa do Fórum[/color:c9972dbd8a][/b:c9972dbd8a]

Pesquisar pelos termos
_____________________________________________
[b:c9972dbd8a]Veja como[url=http://forum.clubedelphi.net/viewtopic.php?t=16976] OBTER RESPOSTAR RÁPIDAS[/url][/b:c9972dbd8a]
[b:c9972dbd8a]Veja as novas [url=http://forum.clubedelphi.net/viewtopic.php?t=59817]MUDANÇAS NA ESTRUTURA[/url] do site[/b:c9972dbd8a]
[b:c9972dbd8a]Leia sempre as [url=http://forum.clubedelphi.net/viewtopic.php?t=6689]REGRAS DE CONDUTA[/url][/b:c9972dbd8a]


Responder

Gostei + 0

31/03/2005

Kotho

Eu utilizo ClientDataSet1.ChangeCount


Responder

Gostei + 0

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar