query1.applyupdates[query1];这一句错在哪
解决方案 »
- 为什么我的fastrepore报错?
- 求证信息
- 程序退出時出現的外部異常external exception c000006一般是什麽原因引起的?
- 如何得到系统“Internet选项”中的代理服务器设置?
- 用treeview调用数据库并且将数据保存成一种专用数据格式
- @@@@@@@@@@@@@@@@@@一个简单的问题◎◎◎◎◎◎◎◎◎◎◎
- 两个窗体的问题,
- 《留下QQ交个朋友》
- 怎样在一个事件中触发另一个事件
- 请问,mdb格式的文件如何打开?
- 关于计算字段的老问题。没有此方面资料的菜鸟的麻烦事。
- 为什么大家都说数据库的字段名不能用中文,而要用英文?我觉得好象差不多的呀,我用的是.DB数据库。都来说说吧,45分伺候。
Call ApplyUpdates to write a dataset pending cached updates to a database. This method passes cached data to the database for storage, but the changes are not committed to the database. An application must explicitly call the database component抯 Commit method to commit the changes to the database if the write is successful, or call the database Rollback method to undo the changes if there is an error.e.g.
he following procedure illustrates how to apply a dataset cached updates to a database in response to a button click:procedure TForm1.ApplyButtonClick(Sender: TObject);begin
with CustomerQuery do
begin
Database1.StartTransaction;
try
ApplyUpdates; {try to write the updates to the database};
Database1.Commit; {on success, commit the changes};
except
Database1.Rollback; {on failure, undo the changes};
raise; {raise the exception to prevent a call to CommitUpdates!}
end;
CommitUpdates; {on success, clear the cache}
end;end;
datasource1.dataset:=query1;
query1.applyUpdates;
结果是会出提示,确定后能改变记录,但不能保存。