Solved

Multi-table update using ADO

Posted on 2008-10-09
3
349 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
FMX enumerated colours 2 98
QRReport  TQrmemo vertical stretching 1 45
TEMBEDDEDWB how can i change its user agent ? 8 58
Breakpoint doesn't stop in my variable 3 23
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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 Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

786 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