ftinteger field doesn't work

Discussion of open issues, suggestions and bugs regarding Virtual Data Access Components for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
kenny
Posts: 43
Joined: Mon 15 Nov 2004 08:48
Location: Malaysia
Contact:

ftinteger field doesn't work

Post by kenny » Thu 19 May 2005 10:46

Hi
I'm using delphi5 Ent, MyDac 3.50.0.19

I'd a field where datatype set to ftinteger in my virtual table. It has no effect when I assigned value for it.
with vtsort do begin
edit;
fieldbyname('PAY').value := 1;
post;
end;
The value of pay remain as 0. But if I try to assign as
with vtsort do begin
edit;
fieldbyname('PAY').AsInteger := 1;
post;
end;
Then it work. Why?

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Fri 27 May 2005 08:42

We cannot reproduce your problem with Delphi 5 (Build 5.62) Ent, MyDac 3.50.0.19 . Please try the following

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
var
  VirtualTable1: TVirtualTable;
  f: TFieldDef;
begin
  VirtualTable1 := TVirtualTable.Create(nil);
  with VirtualTable1 do begin
    f := FieldDefs.AddFieldDef;
    f.Name := 'PAY';
    f.DataType := ftInteger;
    f := FieldDefs.AddFieldDef;
    f.Name := 'f2';
    f.DataType := ftString;
    Open;
    Edit;
    FieldByName('PAY').Value:=1;
    FieldByName('f2').Value:=1;
    Post;
  end;
  DataSource1.DataSet := VirtualTable1;
end;

Post Reply