Delphi: using BigInts from a database

biginteger, database, delphi, sql-server

Solution

Maybe add a TLargeIntField manualy to dataset, set it's FieldName to appropriate name and use such code:

SomeInt64Value := (qryMyQuery.FieldByName('blahblah') as TLargeIntField).AsLargeInt;

Do not remember exactly types, but it worked this way in Delphi6.

Problem

I´m using `Delphi 7` with `devart dbExpress` to connect to `SQLServer`. The problem is that when I add a `bigInt` field to a `ClientQuery` it comes as `TFMTBCDField`. And the `TFMTBCDField` don´t have a method to get the 64 bit value. I can use the `Field.AsVariant` or the `StrToInt64(Field.AsString)` to pick this 64 bits value. Is there a better way to pick/use this value?

Original source