Recent

Author Topic: [SOLVED] To Button "Commit", I would like to add functionallity "refresh".  (Read 4290 times)

Elmug

  • Hero Member
  • *****
  • Posts: 849
Hi everyone,

I have a button called "Commit" which does:
   SQLQuery1.ApplyUpdates;
   SQLTransaction1.CommitRetaining;   


and would like it to also do a REFRESH, same as what the Navigator-refresh does, so I can hide the Navigators' refresh, and so the Commit button does the refresh at once.

How to do it?

Also, where to find document on using methods of the Navigator component?

Thanks!
« Last Edit: June 29, 2012, 02:01:31 am by Elmug »

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: To Button "Commit", I would like to add functionallity "refresh".
« Reply #1 on: June 27, 2012, 01:31:38 pm »
DBNavigator is just calling Refresh on the dataset. So do a
Code: [Select]
SQLQuery1.Refresh;

Elmug

  • Hero Member
  • *****
  • Posts: 849
Re: To Button "Commit", I would like to add functionallity "refresh".
« Reply #2 on: June 27, 2012, 10:22:20 pm »
DBNavigator is just calling Refresh on the dataset. So do a
Code: [Select]
SQLQuery1.Refresh;

Thank you very much, ludob.

That surely will do it.

Would you please kindly provide a link to where one can study about the SQLQuery.Refresh method, and also about the methods that the the other Navigator buttons call, or can call?

Thanks again!

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: To Button "Commit", I would like to add functionallity "refresh".
« Reply #3 on: June 28, 2012, 07:50:19 am »
Elmug: good idea that your'e asking for documentation to help you find things.

Regarding links: have a look in the wiki; search on sqlquery.... or perhaps on refresh.

If you can't find documentation there, it could be in the FPC documentation (see the links indicated).

If it isn't there, you can have a look through the source code.... where you could just as easily have found what ludob told you about it just calling .Refresh...

See here:
http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F
for more details...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Elmug

  • Hero Member
  • *****
  • Posts: 849
Re: To Button "Commit", I would like to add functionallity "refresh".
« Reply #4 on: June 28, 2012, 10:36:39 pm »
Elmug: good idea that your'e asking for documentation to help you find things.

Regarding links: have a look in the wiki; search on sqlquery.... or perhaps on refresh.

If you can't find documentation there, it could be in the FPC documentation (see the links indicated).

If it isn't there, you can have a look through the source code.... where you could just as easily have found what ludob told you about it just calling .Refresh...

See here:
http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F
for more details...

Thank you, BigChimp!

 

TinyPortal © 2005-2018