I'm going to guess the data changes rather frequently. That being the case, I'd create a trigger on INSERT
, UPDATE
or DELETE
that calculates a checksum/CRC that gets stored in some scratchpad table. Retrieve this one value when you populate the listbox, then compare to this value. That will be a good indicator as to whether the data has been changed.
A simpler alternate solution would be to just store the date/time of the last update rather than a checksum.
In one app, we added two columns to the table: IsActive and LastUpdate. IsActive is used in lieu of deleting records outright. LastUpdate is a timestamp indicating the last time each record has been updated. A SELECT WHERE LastUpdate > '<your-previous-check>'
will get you a list of just the changes you need to apply.