Click to See Complete Forum and Search --> : ODBC. How to force data to be written to the disk?


A. Ostroverkhov
February 28th, 2003, 04:42 AM
Hi everybody!

I have a problem while updating data in a database using ODBC.

My application adds new records to the database and soon after tries to read these new records from the database. As a result of buffering, data I read mismatches data I've just written. Thus I need to force data in the buffer to be written to the disk.

In MS SQL it's possible to perfom, using CHECKPOINT statement.

Thank you in advance.

A. Ostroverkhov

antares686
February 28th, 2003, 05:23 AM
WHat type of databae on the backend of the ODBC?

ksl
March 11th, 2003, 10:35 AM
When I was using an Access database from multple applications I have seen a similar problem.

I solved the problem by closing and reopening the CDatabase object that was used for accessing the database. This gives a very slow performence, but soves the problem.

M Owen
March 11th, 2003, 11:23 AM
A,

The next most important question is what language are you doing this in?

ksl
March 12th, 2003, 03:01 AM
I am writing the code in C++ using recordsets derived from the MFC class CRecordset. In the constructor of the objects I always used a CDatabase object.

ergas
March 12th, 2003, 07:55 AM
I think, what you need is called Transaction.
The transaction commands, such as BeginTrans, CommitTrans, or Rollback, in MFC are members of class CDaoWorkspace.

M Owen
March 13th, 2003, 10:01 AM
A,

If I remember to, I'll post some ADO code I wrote that has no delay in it ... It too goes thru ODBC but it does not use the CRescordset class ... You decide what you want to do with it ...

- Mike