Solved

Master-Detail

Posted on 2002-07-22
9
251 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:fhbexpir
ID: 7175481
the table is in edit or indert mode and isn't Readonly
0
 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Suggested Courses
Course of the Month5 days, 6 hours left to enroll

636 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