*** 怎么判断TADOQuery的记录是否被改变?**************写一函数,传入一个TADOQuery,无论对ADOQuery做了任何数据改变的操作(增删改)都返回True值。
对于TQuery,用以下方法可以判断出:
if (Query.Modified) or (Query.UpdatesPending) then
Result := true;但TADOQuery并没有UpdatesPending属性,偶试了好多其它方法都没判断出,请教高手,谢谢!
对于TQuery,用以下方法可以判断出:
if (Query.Modified) or (Query.UpdatesPending) then
Result := true;但TADOQuery并没有UpdatesPending属性,偶试了好多其它方法都没判断出,请教高手,谢谢!
解决方案 »
- 问个简单的问题 treeview1添加节点后怎么进入编辑状态
- 两个程序之间传递数据结构。
- delphi中如何检测是否有pppoe服务?
- CoCreateGUID如何在delphi中使用?
- 打开Delphi经常出现Access Violation in 'coreide60.bpl'错误!!help!!
- 请问哪个可以告诉我一个DELPHI的EXE制作软件的地址给我。
- 我挣一年的钱比不上我的同学年终奖的一半,我实在太厌倦了!
- 有无像visual foxpro 自带的报表设计器那样的报表控件
- 使用BDE Administrator创建一个 Paradox 数据库别名demo,具体怎么操作呀。
- 为什么?我提的问题不见了,我的分也少了?为什么?
- 控件显示顺序的问题。
- 怎么修改
var
customModify : boolean = false;procedure TForm1.ADOQuery1AfterDelete(DataSet: TDataSet);
begin
customModify := true;
end;procedure TForm1.ADOQuery1AfterPost(DataSet: TDataSet);
begin
customModify := true;
end;
TKS。
Returns the number of rows operated upon by the latest query execution.Description
Inspect RowsAffected to determine how many rows were updated or deleted by the last query operation. If no rows were updated or deleted, RowsAffected has a value of zero. RowsAffected will have a value of ? if the execution of the SQL statement could not be executed due to an error condition. This latter situation would typically follow the raising of an exception.
**************
2.属性 FilterGroupDescriptionUse FilterGroup to filter the recordset displayed with an ADO dataset component. The filter requires the dataset be in update batch mode and the rows are filtered based on the update status of individual rows. Set FilterGroup to a TFilterGroup constant to filter the dataset to show just the rows that match that batch update status. For instance, set FilterGroup to fgPendingRecords to show just the rows that have been modified since the last update application.
这样:
if NewValue <> Null then
//改变 else
//没有改变。
or
if CompareText(NewValue,OldValue) <> 0 then
//改变 else
//没有改变。
是字段的。
实时的可以得到它的三个值
NewValue OldValue,Value
可以根据它们判断
Represents the current value of the field component including pending cached updates.
"NewValue"好像是针对TField的,不是对于数据集的,不知对否?
麻烦给个例子,谢谢。
var
vIndex : Integer;
begin
if ADOQuery1.Modified then
for vIndex := 0 to ADOQuery1.FieldCount - 1 do
ADOQuery1.Fields[vIndex].Newvalue := ADOQuery1.Fields[vIndex].Oldvalue;
end;----------------------------------------------------------
等待,如沙漠行舟,痛苦万分
你那方法不行的...
我试了一下..