borland sdac inserted record is not shown when I try to fetch record from within the same connection

49 views Asked by At

I am using borland 6 and sdac5.0 for interaction with MS Access database. However, when I insert a record into the database and try to fetch all data for that table within the same connection, the newly inserted data is not shown.

I have noticed that there was a bug in MS Access Jet4.0 regarding this issue. (https://support.microsoft.com/kb/239114) Unfortunately my system is Windows 7 and I have checked the Jet.dll and I have confirmed that's the latest version and Microsoft has confirmed the issue is solved.

Just wondering is there any method to force the database to update the data to the hard disk? I can sacrifice some performance in order to ensure the integrity of the data.

1

There are 1 answers

0
Gord Thompson On BEST ANSWER

Similar to the related question here, under certain circumstances it may take approximately 5 seconds for a newly-inserted row to be visible in an Access database. This is presumably because Access databases are shared-file databases and the Access Database Engine may make some effort to "batch" commits rather than hit the database file the instant it receives an INSERT/UPDATE query.

To make the update "immediately" available to all users (other connections) we can force the change back to the database file by simply closing the connection from which we performed the update.