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
Solved

ADOQuery cache update

Posted on 2002-04-01
3
2,206 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
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
Downloading email attachments 2 79
Magic Software info 18 138
DBCtrlGrid, Delphi, Scroll 8 38
Delphi Firemonkey: if the Sms contain special characters it won't send it 3 43
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

860 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