Android smartphone

2009-10-08

Update by button


Use TDBEdit toenable users to edit a database field. TDBEdit uses the Text
property to represent the contents of the field.
But:

procedure TForm1.Button1Click(Sender: TObject);
begin
Table1.Edit; // Edit modeenabled
DBEdit1.Text:='ThanhMai'; //Assign Text
Table1.Post; // Write todatabase
end;

Table1 can't update!
My Solution:

procedure TForm1.Button1Click(Sender: TObject);
begin
Table1.Edit; // Edit modeenabled
DBEdit1.SetFocus; // Setsfocus to DBEdit1 !!!
DBEdit1.Text:='ThanhMai'; //Assign Text
Table1.Post; // Write todatabase
end;

No comments: