Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Master-Detail

Posted on 2002-07-22
9
Medium Priority
?
253 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 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
Industry Leaders: 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!

 

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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 course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

886 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