Currency problem
Currency problem
I'm presently changing the communication between my application (Delphi7) and SQL SERVER 2005 SP2. I'll use SDAC 4.35.1.16. In the past the Stored Procedure returns money fields without currency. Now with sdac the currency is include in the dataset and is incompatible with all the reports who are suppose to received a BCD value.
I've read the past topics about that subject and I realize that there is no parameter settings that could be use to exclude the currency from the fields.
Is that still true?
Someone is talking about modifing OLE DB to do that. How can we do that?
I've read the past topics about that subject and I realize that there is no parameter settings that could be use to exclude the currency from the fields.
Is that still true?
Someone is talking about modifing OLE DB to do that. How can we do that?
There is an option. You should set the currency property of the TCurrencyField to False. For example:
Code: Select all
MSQuery1.Open;
(MSQuery1.FieldByName('c_money') as TCurrencyField).currency := False;
NOt an issue for me.
Thanks Antaeus. But all my requests are made via stored procedure call. The solution you gave me does not work for this type of request.
Any other issue?
Any other issue?
The same works for stored procedures returning result sets:
If you get data from the server in another way, describe it here in more details or send me a small test sample to sdac*crlab*com.
Code: Select all
MSStoredProc1.Open;
(MSStoredProc1.FieldByName('c_money') as TCurrencyField).currency := False;
It works now.
Thanks a lot Antaeus. It will need a lot of coding but it will do the job!
where to find in the documentation or Help manual.
Could you tell me where I can find that property (.currency) in the documentation or in the help manual?
Problem with the variable type
Obviously, I have another problem with the variable type when the dataset is transfered to Rave Report. The RAVE application is supposed to receive a BCD type variable and it receives a Currency one.
Is there any technique I could use to convert de datatype of one field of the dataset?
Is there any technique I could use to convert de datatype of one field of the dataset?
I can suggest you the following ways:
1) set the EnableBCD option of your datasets to True and convert your queries so that they return the NUMERIC data type instead of MONEY. For example: 2) perform such converting locally using calculated fields;
3) if you have sources of SDAC, you can change data types mapping in sources. Contact us by e-mail (sdac*crlab*com) to obtain the detailed instructions.
1) set the EnableBCD option of your datasets to True and convert your queries so that they return the NUMERIC data type instead of MONEY. For example:
Code: Select all
SELECT CAST(c_money as NUMERIC(15,2)) c_money FROM tb_money
3) if you have sources of SDAC, you can change data types mapping in sources. Contact us by e-mail (sdac*crlab*com) to obtain the detailed instructions.