Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

TTable.Refresh

Posted on 1999-07-15
29
Medium Priority
?
237 Views
Last Modified: 2012-05-04
I'm writing a Paradox application in Delphi4. Can anyone tell me when/how often I should use TTable.Refresh

Is there an equivalent to make sure that all data are written to the disk?
0
Comment
Question by:juru
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 11
  • 10
  • 5
  • +3
29 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1388750
hi juru,

Refresh, you can do it after each post, or so often you need a actual dataset

FlushBuffers, to force the writeback, but attention the OS will cache also

meikl
0
 
LVL 2

Expert Comment

by:kotik
ID: 1388751
To be sure that all data is written to disk you have to close the table and then reopen.

Table.Close;
Table.Open; // it is not necessary

I tried all: Post, ApplyUpdates and so on, but only closing the table helped me.
0
 
LVL 1

Expert Comment

by:BlackDeath
ID: 1388752
either use

bde command "DbiSaveChanges" or
bde command "DbiUseIdleTime"

! - DbiSaveChanges is not supported w/ sql tables

BlackDeath.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Expert Comment

by:BlackDeath
ID: 1388753
hit me - not bde command: idapi sdk function...

;-)
BlackDeath.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1388754
hit you, bd,

one remark
DbiSaveChanges is called by FlushBuffers

meikl ;-)
0
 
LVL 1

Expert Comment

by:BlackDeath
ID: 1388755
okokokok.

but there's still the sql problem, ain't it (?)

:-|

StupidDeath.
0
 

Author Comment

by:juru
ID: 1388756
Hi BlackDeath

Could you please post an answer with a complete code snippet using  DbiSaveChanges and DbiUseIdleTime. I'm not familiar with anything outside of normal Delphi code.

Thanks

0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1388757
hi all,

a part from the vcl-source

procedure TBDEDataSet.FlushBuffers;
begin
  CheckBrowseMode;
  Check(DbiSaveChanges(Handle));
end;

bd, do your job now ;-)

meikl
0
 
LVL 1

Expert Comment

by:BlackDeath
ID: 1388758
if u've got sql u have 2 use DbiSaveChanges, since DbiUseIdleTime doesn't work w/ sql:

that one is 2 b used explicitly, i.e. every time u wanna write the changes 2 disk, u've gotta make a call 2 DbiSaveChanges like this:

...
Table1.Edit;
Table1.FieldByName('Name').AsString := 'Mr. X';
Table1.Post;
DbiSaveChanges(Table1.Handle);
...

this way u can control when the changes r updated.

if u've got no sql, u can use DbiUseIdleTime.

just put it in2 the applications onidle:

TForm1.FormCreate(Sender: TObject);
...
Application.OnIdle := MyIdle;
...

TForm1.MyIdle(Sender: TObject; var Done: Boolean);
begin
  // if u set Done 2 False, this procedure will not call win api's waitmessage so this procedure will b called repeatedly, what'd cause excessive cpu-time...
  DbiUseIdleTime;
end;

don't 4get 2 put DbiProcs in the uses-clause.

ok, that's it.
if this is enough, tell me, & i'll post an answer; if not, ask.

cheerio,

BlackDeath.

0
 

Author Comment

by:juru
ID: 1388759
Hi folks

You've made me perfectly happy. I'll gladly give away my 50 points. I guess I owe them to the one who first posts an answer instead of a comment.

Please advise, if I'm wrong.

juru
0
 
LVL 1

Accepted Solution

by:
BlackDeath earned 400 total points
ID: 1388760
ok, daddy-o

;-)

BlackDeath.
0
 
LVL 1

Expert Comment

by:BlackDeath
ID: 1388761
kretzschmar,

i'll post a q 4 u w/ 1/2 the pts (i.e. 25) & same rating i'll get from juru if that's ok 4 u.

(i've got pts enough ;-))

BlackDeath.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1388762
hi bd,

i've offered eps a similar option
his comment

---paste begin
Well meikl, if you insist do so, but it's fine with me if you just answer this one and
keep your points. It may not be fair towards other E-E users since there are
more points involved when you post a 'dummy' question.

I will see your dummy question passing by if you don't agree with me or just don't
care about it.
---paste end

i agree with him, therefore keep your points, juru has decide to give the points to you and of course you have done a good job ;-)

meikl
0
 
LVL 1

Expert Comment

by:BlackDeath
ID: 1388763
thanx 4 compliment.

;-)

Black-o-Death.
0
 

Author Comment

by:juru
ID: 1388764
100 pts to BlackDeath and kretzschmar with thanks to all who contributed.

juru
0
 
LVL 1

Expert Comment

by:BlackDeath
ID: 1388765
hey, kretzschmar -
whaddabout asking linda 2 transfer 200 pts from my experts account 2 yours?
(that'd b legal, ain't it? - & juru's intention, i think)

BlackDeath.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1388766
well, we can try, who will ask ?
0
 

Author Comment

by:juru
ID: 1388767
Aren't you guys exagerating? By 100 pts to bd and k I meant 50 + 50=100 total
0
 
LVL 1

Expert Comment

by:BlackDeath
ID: 1388768
juru - u graded the answer a, which means i get 100 pts * 4 (grading a). thus, my account swelled by 400 pts.

it's only fair 2 give the 50 pts to kretzschmar w/ the same factor, i.e. 50 pts * 4 = 200.

kretzschmar - i'll ask her.

bye & have a nice day,

BlackDeath.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1388769
;-) hi juru,

expert-points are depending on your grading
example

you have post a 100 Points q
the expert get if you grade with
A -> 400 Expertpoints
B -> 300 Expertpoints
C -> 200 Expertpoints
D -> 100 Expertpoints

well bd have now get 400 expertpoints from this q
and will give me 200 expertpoints.

well, i don't know if this will be possible

meikl
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1388770
just not seen your comment bd,
have a nice day too

meikl ;-)
0
 

Author Comment

by:juru
ID: 1388771
wow, seems to be one of those days where I learn a lot of new stuff ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1388772
0
 
LVL 7

Expert Comment

by:linda101698
ID: 1388773
There is currently no direct way to divide points between experts (it is an improvement we plan to add).  So we need to work around the programming when situations like this arise.

Since BlackDeath has already been awarded points for his participation, I will post a question for kretzschmar to award an equal number of points.

kretzschmar, look for a question directed to you in this topic area.  Thanks for the great cooperation in finding a solution :-)  I really like the teamwork.

Linda Gardner
Customer Service @ Experts Exchange
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1388774
well, Great, Linda, many thanks. meikl ;-)
0
 
LVL 1

Expert Comment

by:BlackDeath
ID: 1388775
isn't linda an angel?
;-)
BlackDeath.
0
 
LVL 1

Expert Comment

by:BlackDeath
ID: 1388776
isn't linda an angel?
;-)
BlackDeath.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1388777
yup, she is an angel ;-)
0
 
LVL 7

Expert Comment

by:Motaz
ID: 2328678
Thanks for all experts-exchnage team, really they do a great job.

Now I make ex-ex my default homepage in my internet explorer.

Motaz
www.geocities.com/motaz1
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

661 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