Question Delay of database update

pitaridis

Well-known member
Joined
Nov 18, 2005
Messages
63
Programming Experience
10+
Sometimes when I update or insert data in my Access Database and immediately after the update I have to read the updated table, ADO.NET returns me the data as it was in the database before my update.

How can I know if the data was update?

How to avoid this update delay?

Is there some option to get some event (some trap) when the database table update have done or is there a way to ask ADO.NET to store all the database changes before I proceed with my next database job?
 
Updates are not delayed. They are done when you do them. If you save data then it's in the database. If you're not seeing it then either it's not there, i.e. you didn't save it, or else you're retrieving it incorrectly.
 
It is 100% correct. When I do exactly the same with SQL Server it works perfect. I have made my project to work with SQL Server and Microsoft Access and I have problem only with Microsoft Access. If I refresh the page the contents appear exactly as it is supposed to be displayed on the screen.

I solved the problem by displaying a message informing the user about the changes that the application made and I have a link to bring him back to the correct page so that the system will have time to update the information.

This is a temporary solution to my problem and I would like to find a way to solve it without asking the user to do extra operations in order to be able to see the result of his update.
 
this is just for people searching via google - there IS in fact a problem with Access delaying it's update to the database. This is due to what type of record locking you choose:

With pessimistic locking, the record or page is locked immediately when the lock is requested, while with optimistic locking, the update is delayed until all the editing operations on the record have been completed.

Change your settings to pessimistic locking and problem solved.
 
Back
Top