Check for pending updates in batch mode?



Is there a flag, or a status, or a state that lets me know that my recordset
in batch update mode has some pending updates?

The Status property only applies to my current record. i want to know if any
rows have pending updates - without having to do something like:

rs.Filter := adFilterPendingRecords;
bbSaveChanges.Enabled := (rs.RecordCount <> 0)
rs.Filter := adFilterNone;

Since i don't need a list of the pending update records, just if any exist.
Plus, i am sure that the check

if rs.Status <> adRecUnmodified then

is not valid - since there are other Statuses that also are synonymous with
"Unmodified" (i.e. adRe***)


i could do something like:

rs.MoveFirst;
while not rs.EOF do
begin
if rs.Status <> adRecUnmodified then
begin
bbSaveChanges.Enabled := True;
Exit;
end;
end;
bbSaveChanges.Enabled := False;

But i was hoping there was a more efficient (ADO provided) system. Also,
that is a lot of code to write every time i want the simple check.

i could put one the above in a function; but then i am either modifying the
Filter on my recordset, or moving around the recordset. In both cases,
losing my current record.

So i could then write something like:

function RecordsetPendingUpdates(rs: Recordset): Recordset;
var
OldFilter: OleVariant;
OldRecord: OleVariant;
begin
OldFilter := rs.Filter;
OldRecord := rs.Bookmark;

rs.Filter := adFilterPendingRecords;
Result := (rs.RecordCount <> 0);
rs.Filter := OldFilter;
rs.Bookmark := OldRecord;
end;

But now i've had to tell ADO to compile me a list of all records that have
been modified (which i don't really want).
And then compile a list of the existing records (which i had already)
And then seek to where ever the user was.


It would be easier if there was a syntax similar to

bbSaveChanges.Enabled := (rs.Status <> adRecPendingChanges);


.