Datasnap Bug - Setting a TDatetime value to NULL


2005-07-19 08:03:46 AM
off-topic15
I need to confirm if this is a bug with Datasnap/Midas.
Environment : Multi-tier application (for testing, use TAdoDataset,
TDatasetProvider, TLocalConnection and TClientDataset) using D7 Build
8.1, Midas.dll ver 9.0.1882.30496.
Case :
1. Change a TDateTime value of a field using TDbEdit from a existing
value to NULL.
2. Assign the XMLData property of the TClientDataset to a variable.
3. Apply Updates.
Result: The NULL value does not get applied and the old date value is
saved instead.
Code :
procedure TForm1.Button2Click(Sender: TObject);
var S: String;
begin
S := ClientDataSet1.XMLData;
{If the above statement is not called then the NULL value gets applied
back to the DB}
ClientDataSet1.ApplyUpdates(0);
end;
However, using a temp ClientDataset instead, works;
procedure TForm1.Button2Click(Sender: TObject);
var MyCDS: TClientDataset;
begin
MyCDS := TClientDataSet.Create(Self);
MyCDS.Data := ClientDataSet1.Data;
ClientDataSet1.ApplyUpdates(0);
MyCDS.Free;
end;
I need to capture the previous state before the ApplyUpdates, hence the
assignment to the string var.
Regards,
Vikas David