Board index » delphi » Refreshing a TADOQuery dataset

Refreshing a TADOQuery dataset


2005-02-05 02:24:41 AM
delphi36
Hi,
I display MS SQL2000 data with a DBGrid which DataSource is a TDataSource
which DataSet is a TADOQuery (qy1).
With another TADOQuery (qy2), I update the current record of qy1.
Of course, I want to see immediately the new values in the DBGrid. Until now
I did not have a better idea than reading again the whole dataset (qy1)
which has some disadvantages, one of them is when there is big amount of
data...
Does anyone know about a smarter way to do this?
Thanks,
Hubert.
 
 

Re:Refreshing a TADOQuery dataset

Quote
to resysc just the current record.
AdoQuery1.RecordSet.Resync(adAffectCurrent, adResyncAllValues)

You need ADOInt in your Uses clause the constants adAffectCurrent,
adResyncAllValues
Fantastic Brian. It makes my life a lot easier.... Thanks.
Hubert