Solved

Multi-table update using ADO

Posted on 2008-10-09
3
351 Views
Last Modified: 2013-11-23
I'm converting an old application to ADO from BDE and need some help.

A BDEClientdataset has been used to call a stored procedure (via commandtext) to return multi-table data to the screen. The data on-screen is edited in a DB-Aware manner and then, in the OnBeforeUpdateRecord , the data is stored away via another stored procedure and the dataset marked as applied. This all worked fine, but now I need it as ADO.

Just as a test, I added a TADOStoredProc, setting this to the procedure that returns the data and connected it all up. This works fine, returning the data to the screen. I had coded nothing else, but it allowed me to edit some of the fields in the dataset and then post them and it updates the DB.

I didn't expect to be able to edit the dataset let alone it actually updating the DB.

However I need to be able to update all fields as post them to the DB via one means or another. If anyone can help with this that would be great.

N.B. working with SQL Server 2000 & Delphi 6   :-E
0
Comment
Question by:Bongos
  • 2
3 Comments
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 22677301
the last thing for the fields to be editable must be a simple select fields

if you do calculating on a field, like
SELECT ISNULL(Test, 0) TEST ...
will make this field readonly

SELECT A.TEST FROM
(SELECT ISNULL(Test, 0) TEST ...) AS A

should solve this problem

otherwise a little more specifics about the fields not editable ...

0
 
LVL 2

Author Comment

by:Bongos
ID: 22677610
OK, I understand about making the fields editable. For storing the changes am I best to capture the BeforePost and store away via my previous stored proc as I presume it'll no longer update the DB directly?
0
 
LVL 37

Accepted Solution

by:
Geert Gruwez earned 125 total points
ID: 22678142
it will update a cache and then do BeforePost
I don't use ADO anymore, but it seems a good choice to post the updates
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

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…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

765 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