Solved

Master-Detail

Posted on 2002-07-22
9
245 Views
Last Modified: 2010-04-04
To design a data entry form including Master-Detail tables
what should be done no to encounter  the folloeing errors:
  1- Data set is not insert or edit mode
  2- Data set is Read only
Thanks
0
Comment
Question by:fhbexpir
9 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 20 total points
ID: 7170008
1- Data set is not insert or edit mode

use dataset.edit before begin editing

2- Data set is Read only

use a not read only dataset


maybe you should be more concrete

meikl ;-)
0
 
LVL 3

Expert Comment

by:marcoszorrilla
ID: 7170507
You need a master record before inserting a detail record.
MiMaster.Append;
MiMasterCustomerCod.Value:='XXXXXXX';
MiDetail.Append;
MiDetail.BlaBla.Value:='SSSSSS';

Best Regards.
Marcos.
0
 

Assisted Solution

by:kiranramesh
kiranramesh earned 20 total points
ID: 7171289
Hi fhbexpir,

put break point and check where the error is coming.
You must be assigning a value to the table.field without editing the table.

For ex: table.col := 1;
it should be
table.edit;
table.col := 1;
table.post;

Try out, you can do it.

Regards
Kiran.
0
 

Author Comment

by:fhbexpir
ID: 7175481
the table is in edit or indert mode and isn't Readonly
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Expert Comment

by:kiranramesh
ID: 7176529
Hi fhbexpir,

See In delphi if you set master detail it does not automatically set the detail table in insert or edit mode when you put the master in insert or edit mode.
You have to manually code for that.

Else there is a option in the data source component which you link to table called as AUTO EDIT. Set it to true, it should solve your problem. But this is not advisable.

But practically you should control the detail only on master.
I mean to say that only if master is in insert or edit allow the detail to be edited.

If (master.state in [dsEdit,dsInsert]) Then
  Detail.Edit;

Good Luck
Kiran
0
 

Expert Comment

by:kiranramesh
ID: 7176536
Oops I almost forgot,

Please use cached updates to avoid unplesent messages.
For example if you try to post detail first before master while inserting it will give u a message that master record is missing.

Regards,
Kiran.
0
 
LVL 2

Expert Comment

by:ferhad
ID: 7211937
1.Call Edit or Insert method of TTable (Table1.Edit)
2.Dont use ReadOnly Dataset
0
 

Expert Comment

by:CleanupPing
ID: 9343015
fhbexpir:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 5

Expert Comment

by:Lukasz Lach
ID: 9461400
fhbexpir,
No comment has been added lately (18 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: split points between kretzschmar http:#7170008 and kiranramesh http:#7176529

Please leave any comments here within 7 days.

-- Please DO NOT accept this comment as an answer ! --

Thanks,

anAKiN
EE Cleanup Volunteer
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

758 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

19 Experts available now in Live!

Get 1:1 Help Now