Solved

ADOQuery cache update

Posted on 2002-04-01
3
2,114 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:
mnasman 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:mnasman
ID: 6912894
you are welcome :)
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
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…
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now