Solved

Question about ADO cache update (manual post)

Posted on 2004-08-25
4
1,019 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
  • 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Making delphi communicate with a c# service 16 103
Performance of SQL statement 37 111
update joined tables 2 46
Firemonkey allowing RTL on android 6 33
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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

810 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