BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sum of BCD Fields returning when using clientdataset binary

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Multi-Tier)
View previous topic :: View next topic  
Author Message
dannulis
Guest





PostPosted: Mon Aug 11, 2003 10:03 pm    Post subject: Sum of BCD Fields returning when using clientdataset binary Reply with quote



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
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Multi-Tier) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.