那你写一个BOOKMARK,操作完了以后,再回到这个记录的位置不就行了吗?This example uses a button to copy the value of a field in the previous record into the corresponding field in the current record.procedure TForm1.CopyDataClick(Sender: TObject);var SavePlace: TBook; PrevValue: Variant; begin withTable1 do begin { get a book so that we can return to the same record } SavePlace := GetBook; try { move to prior record} FindPrior; { get the value } PrevValue := Fields[0].Value; {Move back to the book this may not be the next record anymore if something else is changing the dataset asynchronously } GotoBook(SavePlace); { Set the value } Fields[0].Value := PrevValue; { Free the book } finally FreeBook(SavePlace); end; end;end;
ADODataSet1.open;
{...do something}
依次用控件AdoConnection,TAdoquery,TDataSource得到数据源,再用TdbGrid显示,我现在想操作这个数据源,但在操作该数据源时总会影响在表格中的显示,我现在想操作他但不影响显示
,不是TADODataSet
我是delphi初学者,帮帮忙,先谢了
SavePlace: TBook;
PrevValue: Variant;
begin
withTable1 do
begin
{ get a book so that we can return to the same record }
SavePlace := GetBook;
try { move to prior record} FindPrior; { get the value } PrevValue := Fields[0].Value; {Move back to the book this may not be the next record anymore
if something else is changing the dataset asynchronously }
GotoBook(SavePlace);
{ Set the value }
Fields[0].Value := PrevValue;
{ Free the book }
finally
FreeBook(SavePlace);
end;
end;end;