Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to save all data to disk after posting a record to Table?

Posted on 2000-04-30
7
Medium Priority
?
164 Views
Last Modified: 2010-04-04
I don't know how to force TTable to write data to disk.
It happens only on very slow machines (ex:486 40 with 8mb ram)

I use TTable and TDataSource. When in my program user adds records to table it can normaly work with them, but if program crashes (or cycles: i:=10 while i<10 do i:=10;) or if computer runs out of power that data does not save to disk. How force to save all data to disk after posting a record? On fast machines all data are updated on-time. And if i crash everything is saved.

Should I use CachedUpdates or...?
I would appreciate example. Thanx.
0
Comment
Question by:Roza
  • 4
  • 2
7 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 2763651
hi roza,

use the ttables flushbuffers method after each post,
to force the bde to write the data to disk,
the only problem is then the os-cache,
which may cache the writing attempts temporary.

meikl
0
 
LVL 2

Author Comment

by:Roza
ID: 2763669
I used FlushBuffers method, but it does not help.

OS cache-possible, but why on computers with very low memory.

It is stupid to tell user. If you want to be sure that your data will actualy be saved, you should restart my program ;)
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 400 total points
ID: 2763736
well, thats true,

another possibility may to close and
reopen the table and relocate the record after each post,
but this will slow down your performance.

meikl
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:Roza
ID: 2764277
What do you mean with "relocate record"?
0
 
LVL 1

Expert Comment

by:BlackDeath
ID: 2768483
hi roza, hi meikl.

you can deactivate the os cache.
in win95 it's

(hm. i've got a german version so i don't know the english terms... in german it's as follows)

systemsteuerung-
system-
leistungsmerkmale-
dateisystem-
fehlerbehebung-
verzögertes schreiben für alle laufwerke deaktivieren

in english it 's kinda:

control panel-
system-
?- [fourth tab]
file system (?)-
?- [third tab]
deactivate cached updates for all drives (?)

and there's a possibility for similar settings in windows nt and windows 2000, too.

BlackDeath.
0
 
LVL 2

Author Comment

by:Roza
ID: 2771236
Hi BlackDeath

Thanx for a hint.

Meikl's iddea about closing and reopening table works quite fine. Good side is that it does not affect on other programs..

I will keep this question open for a few days if somebody finds some other idea.. otherwise I'll be satisfied with simple (not very nice), but workable idea ;)

BTW: my cycle in questin is not actualy a cycle ;) I guess you understand what i meant (endless loop:  i:=10;  while i=10 do i:=10)

Roza
0
 
LVL 2

Author Comment

by:Roza
ID: 2785477
That sollution works and it does not affect on other programs (with changing system cacheing you would affect)

If anybody finds some other sollution.. I will be happy and give points for some faster sollution.

Best wishes from Roza!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question