Page 1 of 1
BCD Overflow after updating from 3 to 4
Posted: Mon 10 Nov 2008 18:57
by wdwhitaker
Delphi 7.0
4.45.0.12
SQL Server 2005
I have just updated to 4 from 3 and simply installed over previous version and now when running application (without recompile), I am trying to post data using stored procedure, and getting BCD overflow error. Works fine in 3.
EnableBCD is unchanged from default.
Procedure called is following:
spInsertRates.parambyname('currid').asinteger := DeltaValueNum(DeltaDS,'CurrencyID');
spInsertRates.parambyname('currrate').asfloat := DeltaValueNum(DeltaDS,'CRate');
spInsertRates.parambyname('currdate').asSQLTimeStamp := DateTimeToSQLTimeStamp(DeltaValue(DeltaDS,'CDate'));
spInsertRates.parambyname('user').asstring := g_user;
spInsertRates.execproc;
Posted: Tue 11 Nov 2008 14:20
by Dimon
Please try to set the EnableBCD option to False. Does it solve the problem?
Posted: Tue 11 Nov 2008 18:55
by wdwhitaker
Dimon wrote:Please try to set the EnableBCD option to False. Does it solve the problem?
I set enableBCD = False and recompiled the program with the newer version. It seemed to work, but how does that effect my program where certain fields are formatted as BCD or FmtBCD?
Posted: Tue 11 Nov 2008 22:22
by wdwhitaker
wdwhitaker wrote:Dimon wrote:Please try to set the EnableBCD option to False. Does it solve the problem?
I set enableBCD = False and recompiled the program with the newer version. It seemed to work, but how does that effect my program where certain fields are formatted as BCD or FmtBCD?
I take that back. It did not solve the problem. Still getting BCD Overflow. What do I need to look at to solve this problem?
Posted: Wed 12 Nov 2008 13:00
by Dimon
I could not reproduce the problem.
Please send me a complete small sample at dmitryg*devart*com to demonstrate it, including script to create and fill table.
Posted: Fri 23 Jan 2009 16:32
by sparkz
I'm getting this problem as well (same version of SQL and Delphi). On version 3 it was fine. Loaded the new driver (4.45.0.14) and I get the problem with BCD overflow.
I set the EnabledBCD option to False and recompiled and it didn't make any difference.
I get the error when calling a procedure via TSQLStoredProc which has several parameters of type MONEY. It never arrives at the procedure code.
It's easy to reproduce. You just need a empty procedure with a single MONEY parameter.
Loading the parameters like so:
Proc1.Params.CreateParam(ftCurrency, 'Value', ptInput);
...
Proc1.ParamByName('Value').AsCurrency := 100.0;
Execute it (ExecProc) and you get the error.
Thanks
Edit: I've emailed you a very small example which recreates the problem for me. It doesn't involve tables just an empty procedure with one MONEY parameter and a few lines of code to call it.
Posted: Tue 27 Jan 2009 09:55
by Dimon
The problem is that the EnabledBCD option is an extended option of DbxSda. Delphi 7 has restriction of dbExpress for setting such options. In order to overcome restrictions of dbExpress, DbxSda provides the TCRSQLConnection component. Extended options are available with TSQLConnection only at run time. To convert quickly from TSQLConnection to TCRSQLConnection you can use the "Convert to TCRSQLConnection" item of component's pop-up menu.
If you need to use TSQLConnection, then you should use the following code at run time:
Code: Select all
const
coEnableBCD = TSQLConnectionOption(102);
. . .
SQLConnection1.SQLConnection.SetOption(coEnableBCD, Integer(False));
You can find more detailed information about it in Readme.html.