Solved

Multi-table update using ADO

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

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 36

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
System restore point 4 77
Delphi selector screen 2 57
How to debug For loops? 3 33
Convert a string into a TDateTime 5 44
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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 video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now