Force Access to flush data.

A

Albert

Hello expert,

I uses AccXP with ADO to access data in JET database. My form is bound to table which is a linked table. In Form_AfterUpdate event, I uses ADO to access form's current record which has just been updated (I think) by open connection to the source database of the linked table and select this record from the opening connection.

Problem is the data I read. It is not the updated data. If I wait for 4-5 seconds before start reading, I will get the correct data. I think it caused by some JET engine parameters regarding page timeout. With those parameters, Access wait for a specific time before data is actually written to disk.

1) Have anyone know How to force Access to flush pending data to disk immediately ? Please remeber the data is on the form. User edit and save it. Data is not manipulated by my program, Access does. I just want to read it in Form_AfterUpdate event.

2) If 1) can not, Have any function()/property to check whether data is still pending or not ? I will use it to loop my program until data is actually written to disk.

Regards,
Albert
 
D

david epsom dot com dot au

Perhaps you could use the dao.dbRefreshCache option of the
application.dbengine.idle method,
or change the PageTimeout registry value or Jet Option, but it would
probably be better to use
the form .RecordSet object for your ADO code, as discussed in your other
thread.

(david)


Hello expert,

I uses AccXP with ADO to access data in JET database. My form is bound to
table which is a linked table. In Form_AfterUpdate event, I uses ADO to
access form's current record which has just been updated (I think) by open
connection to the source database of the linked table and select this record
from the opening connection.

Problem is the data I read. It is not the updated data. If I wait for 4-5
seconds before start reading, I will get the correct data. I think it caused
by some JET engine parameters regarding page timeout. With those parameters,
Access wait for a specific time before data is actually written to disk.

1) Have anyone know How to force Access to flush pending data to disk
immediately ? Please remeber the data is on the form. User edit and save it.
Data is not manipulated by my program, Access does. I just want to read it
in Form_AfterUpdate event.

2) If 1) can not, Have any function()/property to check whether data is
still pending or not ? I will use it to loop my program until data is
actually written to disk.

Regards,
Albert
 
A

Albert

..dbRefreshCache can't help. I have tested by place it on the first line of
Form_AfterUpdate event. Nothing change.

For PageTimeout registry, I also reduce to small milisecond but seem not
work also.

Anyway, Thanks for your reply.
 
J

John Mishefske

Albert said:
.dbRefreshCache can't help. I have tested by place it on the first line of
Form_AfterUpdate event. Nothing change.

For PageTimeout registry, I also reduce to small milisecond but seem not
work also.

Anyway, Thanks for your reply.

Perhaps try this:

dbengine.Idle dbForceOSFlush

after a record save (or implicit save) on client to force an update?
 
D

david epsom dot com dot au

Although you can put any number after dbEngine.Idle,
I think dbForceOSFlush is an option of CommitTrans.

In A2K+, I don't think DAO BeginTrans and CommitTrans
can be easily used with a bound form. (Although I
haven't tried it, I thought the forms where on a
different connection to the default DAO workspace
in A2K?)


(david)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top