Solved

Question about ADO cache update (manual post)

Posted on 2004-08-25
4
1,029 Views
Last Modified: 2008-01-09
I have tried to use ADO cacheupdate in Delphi. Using direct edit, insert and call updatebatch, it works fine. However, I want to do by let a user to directly work with DBGrid and then post the update but using another stored procedure.

Normally, I let the user directly edit/insert the dataset and I write OnBeforePost to Insert/Update manually using stored procedure (via another TADOStoredproc).

ID := DoMyDataSetPost(DataSet);
DataSet.Cancel;
(DataSet as TADODataSet).Requery;
DataSet.Locate('MyPK',ID,[]);
Abort;

The question is how to do this when I am using CacheUpdate. Maybe I have to filter Pending record and loop to post each record like one above, Right?
0
Comment
Question by:soapsiam
[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
  • 3
4 Comments
 
LVL 6

Expert Comment

by:bpana
ID: 11907783
I didn't quite understood your question ...

An example:

- open the ADOTable (or whatever compenent you use)
- set it's connection property to nil. Now you have a disconnected recordset.
- after the user finish his work, update all the modified records (filter the recordset by adFilterPendingRecords)

if needed:
- set the ADOTable connection back to the ADOConnection you use.
- requery ADOTable
0
 
LVL 6

Accepted Solution

by:
bpana earned 125 total points
ID: 11927373
>> The question is how to do this when I am using CacheUpdate. Maybe I have to filter Pending record and loop to post each >> record like one above, Right?

It depends when do you want to update the data. After each record modification or when the user finish all the modifications ?

If after each record, take a look here for an example (I provided an example using a disconnected recordset):
http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_21109554.html

If after all the modifications, you will filter the recordset and for each modified record you will call the corresponding stored proc (insert, update, delete)

If you have any questions, please ask.
Bogdan
0
 
LVL 1

Author Comment

by:soapsiam
ID: 11939612
Using cached update and Disconnect dataset, Does it have problem with data aware control for example TwwLookupDBCombo?
0
 
LVL 6

Expert Comment

by:bpana
ID: 11939799
i didn't use a TDBLookupCombobox on disconnected datasets, but I don't see why it should be any problem.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses
Course of the Month5 days, 10 hours left to enroll

626 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