Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Question about ADO cache update (manual post)

Posted on 2004-08-25
4
Medium Priority
?
1,037 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 375 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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

721 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