Link to home
Start Free TrialLog in
Avatar of soapsiam
soapsiam

asked on

Question about ADO cache update (manual post)

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?
Avatar of bpana
bpana

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
ASKER CERTIFIED SOLUTION
Avatar of bpana
bpana

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of soapsiam

ASKER

Using cached update and Disconnect dataset, Does it have problem with data aware control for example TwwLookupDBCombo?
i didn't use a TDBLookupCombobox on disconnected datasets, but I don't see why it should be any problem.