Subject | Re: [IBO] Parameter Values Problem (decimalseparator changed) |
---|---|
Author | Jason Wharton |
Post date | 2003-06-30T18:29:20Z |
Please make the modifications in the sources and send me the file privately
and I will consider merging your changes in. Please be sure to include
proper credits to your self in the source header files.
Regards,
Jason Wharton
and I will consider merging your changes in. Please be sure to include
proper credits to your self in the source header files.
Regards,
Jason Wharton
----- Original Message -----
From: "Calin Iancu Pirtea" <pcalin@...>
To: <IBObjects@yahoogroups.com>
Sent: Sunday, June 29, 2003 4:02 AM
Subject: [IBO] Parameter Values Problem (decimalseparator changed)
> How to show the problem:
>
> -create a query with a currency parameter
> -set the paramater at design time to some value
> -at runtime change the decimalseparator
> -prepare the query
>
> Example:
> Parameter at design time='0.000' note the decimal separator='.'
> At runtime decimalseparator=','
> On prepare the query will try to set the design time parameters
> but StrToCurr will fail because '0.000' is not valid due to the new
> decimalseparator ','.
>
> Solutions:
> 1)Don't use design params where decimalseparator will change
> 2)Use OldParamValueLinks.Clear before prepare
> 3)Modify SysRestoreParamValueLinks to change the decimalseparator
> in existent old parameters.
>
> It would be nice to have 3 integrated into IBO.
> It is very simple:
>
> IBA_Statement.imp
> in SysRestoreParamValueLinks add the next lines before AsString := tmpStr
> <snip>
> with Params[ii] do
> if not IsBlob and not IsArray then
>
> <snip>
> if IsCurrencyDataType then //Added line
>
> tmpStr[Length(tmpStr)+SQLScale]:=DecimalSeparator;//Added line
> AsString := tmpStr;
>
>
> Probably it could be used depending on SQLScale<>0 instead of
> IsCurrencyDataType
> but I'm not sure about that.
>
>
> Ciao,
>
>
> Best regards,
> Application Developer
> Calin Iancu, Pirtea
> S.C. SoftScape S.R.L.
> pcalin@...