?
Solved

ADOQuery cache update

Posted on 2002-04-01
3
Medium Priority
?
2,334 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 400 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month11 days, 12 hours left to enroll

752 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