Out of sync with two connections

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using a User Control that reads and writes data to an Access Database
using OLE DB classes (OleDbConnection...) I believe the control is storing
data locally in a DataSet which populates a DataGrid.

My application is trying to read and write data to this same database
directly and I'm using a simple ADODB connection. The trouble is that when I
update the database the changes are not always reflected in the control's
local copy.

It seems the OLE DB connection polls for changes to the DB at an interval of
~5s. If I select a tab which contains the DataGrid within the ~5s the data
is out of sync. If I wait longer than ~5s after the DB update then
everything remains in sync.

Ideally the user control would refresh its DataSet before displaying the tab
with the DataGrid. As it is it only uses the automatic synchronization
(polling). To make matters worse, when tab is changed the control overwrites
my changes to the DB with the contents of the DataGrid which it believes it
most up to date.

My question, is there anything I might do to the DB that would force the
control to update? I have a feeling that this is a long shot...

Thanks,

Terrence
 
Terrence,

If I had a user control that

1. Overwrote database changes
2. Polled an Access database for changes every 5 seconds

the first thing I would do is throw the user control in the trash.

Kerry Moorman
 
To be fair (somewhat)...

The user control I'm using was not designed to be used by multiple
connections (users). Thus I suppose they see their in-memory copy as the
real golden data with the DB as a means to persist the data on disk.

The "polling" is somewhat unclear to me. I know that there is some sort of
5s polling by watching the file read and writes with Sysinternals FileMon.
Every 5s I see a read. After my process updates the database, I see that the
next read made by the UserControl process is followed by a file Flush and
other activity, presumably synchronizing their DataSet.

I believe this type of polling is built in functionality of OLE DB and
ADODB. When I create my ADODB connection I see another polling of the
database file with a period of 5s.

Any other thoughts are appreciated.
 
Back
Top