[英]What is the difference between TDataSet.Insert and TDataSet.Append?
These two code samples appear to do the same thing, is there any difference between them in terms of the way the data is added to the database?这两个代码示例似乎做同样的事情,就数据添加到数据库的方式而言,它们之间有什么区别吗?
procedure TForm1.Button1Click(Sender: TObject);
begin
ADOTable1.Append;
ADOTable1['Name'] := 'Mike';
ADOTable1.Post;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ADOTable1.Insert;
ADOTable1['Name'] := 'Mike';
ADOTable1.Post;
end;
TDataSet.Insert Method - Inserts a new, empty record in the dataset => TDataSet.Insert 方法 - 在数据集中插入一个新的空记录 =>
TDataSet.Append Method - Adds a new, empty record to the end of the dataset => TDataSet.Append 方法 - 将新的空记录添加到数据集的末尾 =>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.