ComponentOne True DataControl 8.0
Microsoft Access Problem with Refreshing Recordsets from Database

Problem

When you need to refresh a recordset with the data currently stored in the database, you use Recordset.Requery. With all databases, except MS Access, it brings you the latest data from the database, including modifications made by other users. In MS Access, however, all changes are held in an internal cache that is flushed to the disk every five seconds (this constant can be changed in the Registry). This cache is unavailable across connections. So, if you use two different ADO connections to the same database, Requery will only bring you the data as it was 5 seconds ago. If you use the same Connection object for different recordsets, each of those recordsets will reflect the latest data without delay when you call its Requery method, which is the correct behavior. But this is unacceptable for a multi-user application, because then every user must have a separate database connection.

Solution

If you use an Access database through True DataControl, it will take care of correct refreshes, flushing the Access cache when necessary. Use TData.SourceRecordset.Requery to refresh a True DataControl with the current database data. This will still include a short delay (a fraction of a second) between sending updates to the database by one user and its availability to another. It is acceptable for multi-user applications, but if you need to synchronize data between different True DataControl controls in one form or application, make sure they have identical connection properties (so Connection Pooling will take effect) or use TData.SourceConnection property to ensure that they use the same connection.

Note

This improvement is unavailable in True DataControl Lite.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback