ParamByName ('XXX').AsLargeInt
Posted: 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
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