dannulis Guest
|
Posted: Mon Aug 11, 2003 10:03 pm Post subject: Sum of BCD Fields returning when using clientdataset binary |
|
|
I am having a strange problem related to clientdataset
savetofile/loadfromfile
with the summing of bcd fields in sql server that I haven't found in
the newsgroups.
Let me explain.....
I am using Delphi 6.0 (Build 6.240).
I create the following table on either SQL 2000 or SQL 7...
Create Table TestBCD (TestField numeric(19,2) not null)
and run the following statements...
Insert Into TestBCD Select 1.43
Insert Into TestBCD Select 0.22
Now, I drop a TADOQuery on a form with the following SQL...
Select Sum(TestField) From TestBCD
I hook a TDataSetProvider to that TADOQuery and a TClientDataSet to
that provider. If I open the TClientDataSet, the value 1.65 is
returned, as expected. If I open the clientdataset, and run the
code....
ClientDataSet1.SaveToFile('c:test.bin', dfbinary);
I now have the clientdataset saved as a binary.
If I drop another clientdataset onto the form and set the filename to
'c:test.bin' and activate it, the value 0 is returned.
Even stranger is that if I save the file using dfXML, the
clientdataset correctly displays 1.65 when the file is loaded.
Another strange thing is that if I use the SQL text
Select convert(numeric(19,2), Sum(TestField)) From TestBCD
everything works fine.
I have run into the problem using 2 different versions of midas.dll
6.0.10.157
7.0.4.453
Anyone have any thoughts/ideas??
Thanks,
Dennis
|
|