?
Solved

Master-Detail

Posted on 2002-07-22
9
Medium Priority
?
252 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 60 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 60 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
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.

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

719 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