How do I get ADOTable1.Post to immediatley update the database in delphi?

I update data in a access (2003) database. I immediatley want to access the database and at the moment, I have to put a Sleep command in. I have seen comments on ApplyUpdates for other databases but Access doesn't have one. Is there something else I can use?
Neil_JessopAsked:
Who is Participating?
 
briangochnauerConnect With a Mentor Commented:
It's really a design problem not a Delphi problem.
Are these separate applications you're calling 'Forms"?

If not, put the ADO data objects in a DataModule; so they can share an ADOConnection
Or put the ADOConnection on a common unit.
Or you could use a ClientDataset object and local data provider in a DataModule
0
 
briangochnauerCommented:
ApplyUpdates  is part of the component TClientDataset;
What component are you using to access Access?  
dbExpress
TSQLQuery
TSQLTable
 ADO  
TADOTable
TADOQuery
BDE
TTable
TQuery
 
0
 
Neil_JessopAuthor Commented:
I am using TADOTable to update the data, and TADOQuery to subsequently read it.
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
briangochnauerCommented:
Huh? That can't work really.
The answer to your original question is use Post method like;
MyTable1.Post;
commits the data to the database; but I think you have other issues;
since you can update ADOTable without first reading it;
And if your querying with ADOQuery why not update it?
0
 
Neil_JessopAuthor Commented:
I use a ADOTable.Post to commit the data to the database on one form.

On another form I try to read data, automatically, using a ADOQuery. The trouble is that when reading the data in the ADOQuery, it seems that the ADOTable.Post event hasn't written it to the database. If I put a Sleep(5000) between the ADOTable.Post and the read in using the ADOQuery, it works. But I have the problem that Sleep(5000) works on my machine but I have to use longer on other machines. I wondered if there was any other way?

0
 
briangochnauerCommented:
How do I get ADOTable1.Post to immediatley update the database in delphi?
Close it,  
ADOTable.Close;
0
 
Neil_JessopAuthor Commented:
Sort of answered but there is a better way.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.