VirtualTable and LargeInt field
VirtualTable and LargeInt field
Hello,
I have problem with LargeInt field in VT.
The Int64 values stored in that field are converted to integers and are overloaded (positives goes to negatives).
The export to XML file is incorrect too.
Meanwhile I use the float fields to store Int64 values.
Is there a bug or I do something wrong ?
Regards
Michal
I have problem with LargeInt field in VT.
The Int64 values stored in that field are converted to integers and are overloaded (positives goes to negatives).
The export to XML file is incorrect too.
Meanwhile I use the float fields to store Int64 values.
Is there a bug or I do something wrong ?
Regards
Michal
Re: VirtualTable and LargeInt field
Hello,
The below code demonstrates correct functioning of VirtualTable. Please modify so that the issue is reproduced, and send it back to us.
The below code demonstrates correct functioning of VirtualTable. Please modify so that the issue is reproduced, and send it back to us.
Code: Select all
program Project1;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils, Data.DB, VirtualTable;
var
VT: TVirtualTable;
begin
VT := TVirtualTable.Create(nil);
try
VT.AddField('Largeint', ftLargeint);
VT.Open;
VT.Append;
VT.FieldByName('Largeint').AsLargeInt := High(Int64);
VT.Post;
VT.Refresh;
Writeln(IntToStr(VT.FieldByName('Largeint').AsLargeInt));
finally
VT.Free;
readln;
end;
end.
Re: VirtualTable and LargeInt field
Hello Alex,
This project doesn't compile.
VT.FieldByName('Largeint').AsLargeInt := High(Int64);
The AsLargeInt doesn't exist. I use UniDac 6.1.6 and BDS 2006 Prof.
Regards
Michal
This project doesn't compile.
VT.FieldByName('Largeint').AsLargeInt := High(Int64);
The AsLargeInt doesn't exist. I use UniDac 6.1.6 and BDS 2006 Prof.
Regards
Michal
Re: VirtualTable and LargeInt field
This behavior is due to implementation of the standard method SetAsInteger в классе TLargeintField in the DB.pas module. The parameter of this method is an argument with Longint type, therefore a value greater than Longint will be mapped as -1.
Re: VirtualTable and LargeInt field
Hello,
There are any solution ?
Regards
Michal
There are any solution ?
Regards
Michal
Re: VirtualTable and LargeInt field
for RAD Studio 2006
Code: Select all
program Project1;
{$APPTYPE CONSOLE}
{$R *.res}
uses
SysUtils, DB, VirtualTable;
var
VT: TVirtualTable;
begin
VT := TVirtualTable.Create(nil);
try
VT.AddField('Largeint', ftLargeint);
VT.Open;
VT.Append;
TLargeintField(VT.FieldByName('Largeint')).AsLargeInt := High(Int64);
VT.Post;
VT.Refresh;
Writeln(IntToStr(TLargeintField(VT.FieldByName('Largeint')).AsLargeInt));
finally
VT.Free;
readln;
end;
end.
Re: VirtualTable and LargeInt field
Hello,
Thanks Alex. It works.
Regards
Michal
Thanks Alex. It works.
Regards
Michal
Re: VirtualTable and LargeInt field
Glad to see that the issue was resolved. If you have any further questions, feel free to contact us.