Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
-
yartoo
- Posts: 18
- Joined: Fri 11 Jun 2010 00:54
Post
by yartoo » Wed 20 Oct 2010 03:37
We are having trouble with the .AsLargeInt method of the TParams class.
We have large integer values in the database and want to assign the values as large integers; e.g.
TheQuery.SQL.Add ('Select *');
TheQuery.SQL.Add ('from Prodn_unit');
TheQuery.SQL.Add ('where Unit_id = :UnitId');
TheQuery.ParamByName ('UnitId').AsLargeInt = fUnitId;
where fUnitId is declared as an Int64;
When we do this we get the following error...
"Error converting data type varchar to bigint."
We currently work around this by checking all parameters in all queries and changing the data type from ftLargeInt to ftString when the database is Ms SQL Server. (We are supporting multiple database systems in our application). AsLargeInt works for other databases in DbExpress.
Is this a problem in the Devart DbExpress driver or Ms SQL Server?
Shaun
-
AndreyZ
Post
by AndreyZ » Wed 20 Oct 2010 14:19
Hello,
Please specify what SQL Server type you are using for the Unit_id field. For storing Int64 data types in SQL Server you have to use bigint type.
-
yartoo
- Posts: 18
- Joined: Fri 11 Jun 2010 00:54
Post
by yartoo » Wed 20 Oct 2010 16:06
AndreyZ,
Ms SQL Server 2005
Unit_id is a bigint
Shaun
-
AndreyZ
Post
by AndreyZ » Thu 21 Oct 2010 07:27
Please specify the following information:
- the exact version of DbxSda;
- the exact version of your IDE.
-
yartoo
- Posts: 18
- Joined: Fri 11 Jun 2010 00:54
Post
by yartoo » Thu 21 Oct 2010 23:20
AndreyZ,
DbxSda:
File and Product version: 4.75.0.26
Delphi RAD Studio:
Embarcadero® Delphi® 2010 Version 14.0.3593.25826
Thanks
Shaun
-
Dimon
- Devart Team
- Posts: 2910
- Joined: Mon 05 Mar 2007 16:32
Post
by Dimon » Tue 26 Oct 2010 09:04
Thank you for the information. We have reproduced this problem and fixed it. This fix will be included in the next DbxSda build.
-
yartoo
- Posts: 18
- Joined: Fri 11 Jun 2010 00:54
Post
by yartoo » Tue 26 Oct 2010 12:22
Thanks Dimon.
As soon as we get it, I'll rip out all that ugly parameter searching code.
Shaun