Recent

Author Topic: ZEOS: How to disable auto POST in ZQuery  (Read 3851 times)

blastertemp

  • Newbie
  • Posts: 2
ZEOS: How to disable auto POST in ZQuery
« on: July 06, 2012, 11:23:45 am »
When user add one row in DBGrid and move to another row, the new row is POST into DB.
But user needs to add more than one row in DBGrid, and after confirmed, POST them into DB together.

In ADOQUERY, we can set TADOQUERY.LockType  = ltBatchOptimistic;
But for ZQuery, how to disable auto POST in ZQuery?

Thanks!

ttomas

  • Full Member
  • ***
  • Posts: 198
Re: ZEOS: How to disable auto POST in ZQuery
« Reply #1 on: July 06, 2012, 12:46:30 pm »
You can use ZQuery1.CashedUpdates := True property
When you finish all updatest call ZQuery1.ApplyUpdates; or CancelUpdates

atasoft

  • New Member
  • *
  • Posts: 28
Re: ZEOS: How to disable auto POST in ZQuery
« Reply #2 on: July 06, 2012, 06:48:14 pm »
Change the Autocommit property of ZConnection to False. This will affect all the queries. The records of dbgid will still be posted but not commited to db. Then you should add a button to commit the changes to db.

blastertemp

  • Newbie
  • Posts: 2
Re: ZEOS: How to disable auto POST in ZQuery
« Reply #3 on: July 09, 2012, 03:15:30 am »
by setting ZQuery1.CashedUpdates = True, it works.
Thank you!

 

TinyPortal © 2005-2018