Database INSERT: use Flush

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Nov 26 10:26:49 CST 2003


on 11/26/03 1:27 AM, Arthur Clemens at aclemens at xs4all.nl wrote:

> Aarg!
> Just spent more than one hour on the question why my database is
> corrupt when viewing it in Valentina Carbon, after only inserting 2
> records with SqlExecute(). Read somewhere in the archive that I need to
> call mydatabase->Flush() after INSERT. Works ok now.

> But I wonder why this is not written in the SQLReference...

Hi Arthur,

Well, yes, INSERT, as well as cursor->AddRecord() do not save record on disk
immediately.

This allows you very fast add of e.g. 1000 records, and then only one flush.


But I wonder, if you in YOUR app add by INSERT 2 records,
DO NOT do flush,
But you should do CLOSE() yes?

Then only you can go and open db in VAPP.

Close() do flush self, so you should not see problems.


If you open in VAPP db that is NOT closed by YOUR app then you can get
problems. Although VAPP should refused that.

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list