Board index » delphi » Problem with SQLServer date format using ADO and ClientDataSet

Problem with SQLServer date format using ADO and ClientDataSet

I got the following problem accessing SQL Server using a ClientDataSet and
ADO components:
In my 3-tier application I have a TADOTable on the ApplicationServer side,
and a TClientDataSet connected via TSocketConnection on the Client side.
At the Client, when I try to edit a record containing a datetime field with
a time included on the value (i.e. 20/10/2002 14.30.00) I got this
ReconcileError

  record changed by another user

and at this point I have no way to update the record. I tried using BDE
instead of ADO and this error doesn't appears: I'm sure that it's a bug of
ADO components.
Does somebody know if it exists a patch to fix it?
Thanks
Matteo

-------------------------------
Message Posted by  <dedGateway>
http://www.dedonline.com/forumb

 

Re:Problem with SQLServer date format using ADO and ClientDataSet


Quote
>ADO components:
>In my 3-tier application I have a TADOTable on the ApplicationServer side,
>and a TClientDataSet connected via TSocketConnection on the Client side.
>At the Client, when I try to edit a record containing a datetime field with
>a time included on the value (i.e. 20/10/2002 14.30.00) I got this
>ReconcileError

>  record changed by another user

>and at this point I have no way to update the record. I tried using BDE
>instead of ADO and this error doesn't appears: I'm sure that it's a bug of
>ADO components.

The default for updating a record with ADO components is to find the record
using all the field values.   This is different than the BDE default to use just
the updated field.  ADO also trucates datetime fields to the nearest second so
this is probably due to ADO trying to locate the record using a different time
value from what is on the server.

Try setting the updateCriteria property to change the behavior in how ADO
locates a record

Yes. You set the 'Update Criteria' dynamic property:-

ADODataSet1.Properties['Update Criteria'].value :=adCriteriaKey;
put this code in the BeforeUpdate and BeforeDelete events

Your choices are adCriteriaKey, adCriteriaAllCols (BDE's default),
adCriteriaUpdCols (ADO's default) and adCriteriaTimeStamp. Search the
Platform SDK for more details.
http://support.microsoft.com/default.aspx?scid=kb;EN-GB;q190727&GSSNB=1
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads