Solved

ADOQuery cache update

Posted on 2002-04-01
3
2,235 Views
Last Modified: 2008-02-01
I use adoquery and dbgrid, I want to handle the record changes by myself when user finish update all rows.

How can I set this adoquery in cache mode like BDE TQuery? So I can process the data row by row.

Thanks.

Jammy
0
Comment
Question by:jlislo
[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
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 100 total points
ID: 6910956
Hello

  I think if you change the cursor location to: clUseClient, and CursorType to : ctStatic and the locktype to : ltBatchOptimistic that I think will be as you need

from the Delphi Help:

Opening the dataset in batch update mode
o open an ADO dataset in batch update mode, it must meet these criteria:

1     The component’s CursorType property must be ctKeySet (the default property value) or ctStatic.
2     The LockType property must be ltBatchOptimistic.
3     The command must be a SELECT query.

Before activating the dataset component, set the CursorType and LockType properties to the values indicated above. Assign a SELECT statement to the component’s CommandText property (for TADODataSet) or the SQL property (for TADOQuery). For TADOStoredProc components, set the ProcedureName to the name of a stored procedure that returns a result set. These properties can be set at design-time through the Object Inspector or programmatically at runtime. The example below shows the preparation of a TADODataSet component for batch update mode.

with ADODataSet1 do begin

  CursorLocation := clUseServer;
  CursorType := ctKeyset;
  LockType := ltBatchOptimistic;
  CommandType := cmdText;
  CommandText := 'SELECT * FROM Employee';
  Open;
end;

After a dataset has been opened in batch update mode, all changes to the data are cached rather than applied directly to the base tables.

also look at the disconnected recordset
0
 

Author Comment

by:jlislo
ID: 6912861
Thank you very much! It works great.
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6912894
you are welcome :)
0

Featured Post

Industry Leaders: 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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

739 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