Any value greater than MaxInt is truncated, hence AsLargeInt on params fails to return the correct row (select) or stores rubbish (insert, update)
dbexp.pas:
function TCRSQLCommand.setParamDescValue(...): SQLResult;
var
s: string;
sa: AnsiString;
i: integer;
i64: integer;
...
This is the mistake... it should be:
i64: Int64;
otherwise the value is trashed here (about 160 lines later):
dtInt64, dtBcd, dtFMTBcd:
begin
if (dt = dtInt64) and FSQLConnection.FEnableLargeint then begin
i64 := PInt64(pBuffer)^;
ParamDesc.SetValue(i64);
end