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;
BCD Overflow after updating from 3 to 4
-
- Posts: 8
- Joined: Sun 08 Oct 2006 13:55
-
- Posts: 8
- Joined: Sun 08 Oct 2006 13:55
wdwhitaker wrote: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?Dimon wrote:Please try to set the EnableBCD option to False. Does it solve the problem?
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?
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.
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.
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:
You can find more detailed information about it in Readme.html.
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));